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

routing - AngularJS State management ->load multiple states in one page -

python - GRASS parser() error -

post - imageshack API cURL -