1

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 !

4 Answers 4

3

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();"/>
Sign up to request clarification or add additional context in comments.

Comments

2
$('#pass').click(function () {
    $("#list").show();
});

or

change onclick="jQuery("#list").show();"

to

onclick="jQuery('#list').show();"

Comments

1

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>

Comments

0

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();"/>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.