I am trying to add an attribute (rel="tooltip") based on if condition
<div class="symbol"><span title="<%= data%>" <% if ( data.length > 9 ) { rel="tooltip" }%>></span></div>
If I am adding an alert inside if loop it works, where as the attribute change does not work.
This has nothing to do with JavaScript (or Underscore.js) at all.
<% %>are ASP tags, andrel="tooltip"is just setting a variable. You need to have ASP echo out"tooltip"(like you did with the title).