I have the following code in HTML and wanted to replace them using javascript
Original code
<td class="tabButton dijitHidden tweetsTabButton selectedTab" dojoattachpoint="tweetsTabButton" data-type="twitter" style="display: none;">
Tweets
<div class="arrow-up"><div class="arrow-up-content"></div></div>
</td>
Replace it to
<td dojoattachpoint="tweetsTabButton" data-type="twitter" style="display: none;">
<h2>Tweets</h2>
</td>
By the question contents, and the comments currently present, you need to:
Tweetswith an element, specifically<h2></h2>classattribute from thetdto disable CSStableIDpresent and using thedata-typeattribute as verification!See this working Fiddle Example!
javaScript
Note: Could be optimized, but as is you can see what’s happening. Also the comments are there to guide you through, remove when in production.