Here is the sample of code that I've concentrating on. I've tried to incorporate it with my test site and the code doesn't work. I don't understand why, in both instances I'm using the latest version of Jquery (1.5) I'm using Google's hosted Api for my test site.
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js"></script>
<script>
$('#name-label').dblclick(function() {
$("#name").val('some text');
});
</script>
<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>
Does wrapping it in a $(document).ready(function() {});
work?
$(document).ready(function() {
$('#name-label').dblclick(function(){
$("#name").val('some text');
});
});
$(function() {
$('#name-label').dblclick(function(){
$("#name").val('some text');
});
}
精彩评论