javascript - use string in <title> to change string in div -


i using jquery script change strings else based on divs initial string adding class element. works great.

however, got in situation need able target few divs based in string in sites title tags when special users logg in title change.

is possible? both vanilla js , jquery me.

script using:

 $( "span.conditionhilite:contains('standard')" )   .text('approved selection').addclass( "approvedselectionhilite" ); 

i run script only if title contains string.

here code

if($('title:contains("your specific string")')){ // task  $( "span.conditionhilite:contains('standard')" )   .text('approved selection').addclass( "approvedselectionhilite" );  } 

Comments