<div class="ctrlHolder">
<label for="" id="name.label">Name</label>
<input name="name" id="name" type="text" class="textInput small" />
<p class="formHint">The name of the item you are submitting</p>
</div>
How can I insert predefined text into a input element. I'd like this function to active when the user doubleclicks the label element.
$('#name.label').dblclick(function(){
$('#name').val('some text');
});
here check this fiddle
you can use .text("yourPreDefinedText") to replace the text of an element
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With