jQuery contains() with a variable syntax

var vtxt = 'customtext';
$("p:contains('" + vtxt + "')").addClass("on");

No comments:

Post a Comment