Reputation: 311
I don´t know if it´s possible do this , in this case i want when click over input text field activate function in jQuery and after of this action execute the code of jQuery - inside onclick - , i put my example :
<input type="password" name="password" value="" class="input_text_register" id="pass" onclick="jQuery("#list").show();"/>
I can´t do this works , i supose i have some error because no get works finally , in this case the activation from input text field open other div for show informations
Thank´s , Regards !
Upvotes: 1
Views: 25999
Reputation: 56539
Have you included jQuery
library?
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
Better give it as explicit.
<input type="password" name="password" value="" class="input_text_register" id="pass" onclick="clickIt();"/>
<script">
function clickIt() {
jQuery("#list").show();
}
</script>
Upvotes: 1
Reputation: 8954
Either try escaping your quotes like this:
<input type="password" name="password" value="" class="input_text_register" id="pass" onclick="jQuery(\"#list\").show();"/>
or change them
<input type="password" name="password" value="" class="input_text_register" id="pass" onclick="jQuery('#list').show();"/>
Upvotes: 0
Reputation: 57105
$('#pass').click(function () {
$("#list").show();
});
or
change onclick="jQuery("#list").show();"
to
onclick="jQuery('#list').show();"
Upvotes: 2
Reputation: 28773
Try like
<input type="password" name="password" value="" class="input_text_register" id="pass" onclick="myfun();"/>
<script type="text/javascript">
function my_fun() {
jQuery("#list").show();
}
</script>
Or you can also do like
<input type="password" name="password" value="" class="input_text_register" id="pass"/>
<script type="text/javascript">
$(document).ready(function(){
$('#pass').on('click',function(){
jQuery("#list").show();
});
});
</script>
Or even simply you can try like
<input type="password" name="password" value="" class="input_text_register" id="pass"
onclick="jQuery('#list').show();"/>
Upvotes: 3