View Single Post
Old 03-21-2018, 02:31 PM  
2MuchMark
Too lazy to set a custom title
 
Industry Role:
Join Date: Aug 2004
Location: Canada
Posts: 49,937
Question for HTML Guru's

How-do! I have a question.

I want to have an a href with a title that is a variable from a javascript.

For example

<a href = "something.html" title="Variable number">Click</a>

Here's my code:

<a href="something.html" data-toggle="tooltip" title="

<script>
a=<!--per_price_grp-->;
b=10;
c=a/b;
document.write("$" +c.toFixed(2));
</script>


" data-placement="top">


But instead of showing the value of the script, it's showing most of the code.

Suggestions?
2MuchMark is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote