GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Question for HTML Guru's (https://gfy.com/showthread.php?t=1297056)

2MuchMark 03-21-2018 02:31 PM

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?

sarettah 03-21-2018 02:50 PM

Something like:

Code:

<a id=mylink href="something.html" data-toggle="tooltip" title="" data-placement="top">Something</a>

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

.

Bladewire 03-21-2018 02:53 PM

^^^ 5 stars and a :thumbsup for quick reply!

RyuLion 03-21-2018 04:29 PM

Quote:

Originally Posted by sarettah (Post 22241758)
Something like:

Code:

<a id=mylink href="something.html" data-toggle="tooltip" title="" data-placement="top">Something</a>

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

.

Nice, looks good!

blackmonsters 03-22-2018 05:38 AM

Quote:

Originally Posted by sarettah (Post 22241758)
Something like:

Code:

<a id=mylink href="something.html" data-toggle="tooltip" title="" data-placement="top">Something</a>

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

.


:thumbsup

2MuchMark 03-22-2018 06:55 AM

Quote:

Originally Posted by sarettah (Post 22241758)
Something like:

Code:

<a id=mylink href="something.html" data-toggle="tooltip" title="" data-placement="top">Something</a>

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

.

Thank you sir, that worked perfectly!

sarettah 03-22-2018 11:06 AM

Quote:

Originally Posted by 2MuchMark (Post 22242014)
Thank you sir, that worked perfectly!

np


8chars

.


All times are GMT -7. The time now is 06:54 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123