How can i put a default text in an input html element which user can't delete(ficed text on start of the input ) . The second thing what i want that the cursor will be indexedafter this fixed text.
相关问题
- Views base64 encoded blob in HTML with PHP
- Is there a way to play audio on a mobile browser w
- HTML form is not sending $_POST values
- implementing html5 drag and drop photos with knock
-
Why does the box-shadow property not apply to a
If you want to fix this with only an input element you can use an inline svg background.
http://codepen.io/anon/pen/pJoBya
HTML
CSS
To make this work in Internet Explorer you need encodeURIComponent the SVG image http://pressbin.com/tools/urlencode_urldecode/
Absolutely position the text over the beginning of the field then add left padding to the field until the cursor lines up to the right position. See example here: http://www.accessfinancialservices.co.uk/calculators/mortgage-calculator/
try this one might be helpful for you.
http://jsfiddle.net/pZLcg/
I know this question is already answered, but here is another way to do it.
I tested this code with..
just use placeholder="Name" for example: