javascript - how to pass a variable in jquery -


i'm trying pass variable name "mypassword" in function jquery variable value in function return null.how correct this?!

$(document).ready(function ($) {     var mypassword = $('#facebox #mypassword:first').val();     $(mypassword).strength({         strengthclass: 'strength',         strengthmeterclass: 'strength_meter',         strengthbuttonclass: 'button_strength',         strengthbuttontext: 'show password',         strengthbuttontexttoggle: 'hide password'     }); }); 

isn't selector thats wrong (i.e. prepend "."+ or "#" before)?

 var mypassword = $('#facebox #mypassword:first').val();  $("." + mypassword).strength({ ...  

Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -