javascript - How can i print my jquery variable value in to a div however i got my value in variable named as count -


i have selector structure that

 <span class="pr_count">characters <a class="cont"> </a></span> 

and have function gets value when check in console didn't print in html selector

var count = $("#cout_text").text().length ;   $(".pr_count .cont").html("characters" '+' count);  

you have syntax error. + operand must not surrounded quotes. try this:

$(".pr_count .cont").html("characters " + count); 

Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

post - imageshack API cURL -

dataset - MPAndroidchart returning no chart Data available -