Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 03-21-2018, 02:31 PM   #1
2MuchMark
Videochat Solutions
 
2MuchMark's Avatar
 
Industry Role:
Join Date: Aug 2004
Location: Canada
Posts: 45,806
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?
__________________

VideoChat Solutions | Custom Software | IT Support
https://www.2much.net | https://www.lcntech.com
2MuchMark is online now   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-21-2018, 02:50 PM   #2
sarettah
l8r
 
Industry Role:
Join Date: Oct 2002
Posts: 13,506
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>
.
sarettah is online now   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-21-2018, 02:53 PM   #3
Bladewire
StraightBro
 
Bladewire's Avatar
 
Industry Role:
Join Date: Aug 2003
Location: Monarch Beach, CA USA
Posts: 56,232
^^^ 5 stars and a for quick reply!
Bladewire is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-21-2018, 04:29 PM   #4
RyuLion
 
RyuLion's Avatar
 
Industry Role:
Join Date: Mar 2003
Location: San Diego
Posts: 32,053
Quote:
Originally Posted by sarettah View Post
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!
__________________
RyuLion is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-22-2018, 05:38 AM   #5
blackmonsters
Yo Mamma!
 
blackmonsters's Avatar
 
Industry Role:
Join Date: Nov 2002
Location: 🌎🌅🌈🌇
Posts: 19,925
Quote:
Originally Posted by sarettah View Post
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>
.

__________________
Camsoda pays :
Become a Cam Model or Sign up as a Webmaster
blackmonsters is online now   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-22-2018, 06:55 AM   #6
2MuchMark
Videochat Solutions
 
2MuchMark's Avatar
 
Industry Role:
Join Date: Aug 2004
Location: Canada
Posts: 45,806
Quote:
Originally Posted by sarettah View Post
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!
__________________

VideoChat Solutions | Custom Software | IT Support
https://www.2much.net | https://www.lcntech.com
2MuchMark is online now   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-22-2018, 11:06 AM   #7
sarettah
l8r
 
Industry Role:
Join Date: Oct 2002
Posts: 13,506
Quote:
Originally Posted by 2MuchMark View Post
Thank you sir, that worked perfectly!
np


8chars

.
sarettah is online now   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks

Tags
question, javascript, variable, click, code, href, how-do, gurus, html, title



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.