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