I'm pretty new to jquery so am not too knowledgeable on it, I asked a question on using jquery to change the class of certain elements to specific classes if another certain element is present - JQuery - Change certain element classes to specific classes if certain other element is present
It seems that an event listener is needed for this, I have a basic understanding of event handlers but this is generally to do with actions such as click etc what I need however is one to Id if certain elements innerhtml has a text value (e.g. 'go') to run a function on near by elements (example below).
This is for a blog, which will use certain tags to change layout of posts, below there is some repeated html to illustrate how the targetting needs to work
classes are spans (using bootstrap)
html
<div class="container">
<div class="span6">
</div>
<div class="span6">
<a class="taglink">text</a>
</div>
</div>
<div class="container">
<div class="span6">
</div>
<div class="span6">
<a class="taglink">text</a>
</div>
</div>
What I'd like is for a & b's and only a & b's classes to change from span 6 to 12 when the text inside one of the a classes 'taglink' that is within the same container div is equal to 'go'.
This is so that only 'go' tag will affect only 'a' and 'b' divs classes and only that of a and b within its own 'container' div.