There're many solutions on the Net to do this where each div tag has a unique id (e.g.: Select all DIV text with single mouse click), but how am I able to do this for more than one div tag on the same page that use the same class?
The code would look something like this:
<td>
<div class="code" onclick="">int variable_name;</div>
<div class="code" onclick="">int variable_name = value;</div>
<div class="code" onclick="">float variable_name;</div>
<div class="code" onclick="">float variable_name = value;</div>
<!-- etc... -->
</td>
Plain Javascript is preferred for the solution.