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
Post a Comment