Using jQuery find string A or B and replace based on css class and ID
- by Jason
Using jQuery, how do you check for and replace the occurrence of stringA or stringB when it falls under a specific css class and ID?
stringA = " | "
stringB = "|"
css = .login #bav
<p id="nav">
<a href="#">oh ya</a> |
<a href="#" title="Password Lost and Found"></a>
</p>
I have variations of this:
jQuery(document).ready(function($) {
$(".login #nav").replaceText( /testA|testB/gi, "fooBar" );
});
});