javascript - Change a background color of text by taking text name form url -
i want change background colour of text matches url value. have tried this
<script> var full_url = document.url; var url_array = full_url.split('='); var textname = url_array[url_array.length-1]; $("a:contains(textname)").css("background-color", "white");
but it's not working can me? in advance
note here aren't using value of textname
variable in selector, because "a:contains(textname)"
string.
what want is:
$("a:contains("+textname+")").css("background-color", "white");
Comments
Post a Comment