slj90 Posted December 11, 2014 Share Posted December 11, 2014 Usually it would be something like: $("#lblpasswordmessage").html("Password is too short"); But how do you do it using a variable? For example say the variable is called 'pwm'; $("#pwm").html("Password is too short"); $("pwm").html("Password is too short"); $(pwm).html("Password is too short"); Thanks Link to comment https://forums.phpfreaks.com/topic/293018-changing-html-element-using-variable/ Share on other sites More sharing options...
requinix Posted December 11, 2014 Share Posted December 11, 2014 The third, if pwm contains "#lblpasswordmessage". Or if it doesn't include the hash sign then $("#" + pwm) Link to comment https://forums.phpfreaks.com/topic/293018-changing-html-element-using-variable/#findComment-1499246 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.