HTML Tutorial


 /help/HTML Help Forum   FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
RegisterRegister - Not registered yet? Got something to say? Join HTML Code Tutorial!
Inserting CSS info into Javascript
Post new topic   Reply to topic    HTML Help Forum -> CSS
View previous topic :: View next topic  
Author Message
iblum



Joined: 22 Aug 2005
Posts: 5

PostPosted: Fri Aug 26, 2005 7:19 pm     Inserting CSS info into Javascript Reply with quote

I would like to insert CSS info into Javascript code.
I am using Javascript to hide email address on my website, such as:

<script language=javascript>

<!--

var contact = "Comments/Suggestions"

var email = "info"

var emailHost = "netmagik.com"

document.write("<a href=" + "mail" + "to:" + email + "@" + emailHost+ ">" + contact + "</a>" + ".")

//-->

</script>

How do I make the line Comments/Suggestions look the same way as the rest of the site?

I tried to put <script language=javascript class="bottomlink">
where "bottomlink" is the class that defines the look that I want.
It doesn't work that way.
Corey Bryant
Site Admin


Joined: 15 May 2004
Posts: 8748
Location: Castle Pines North, CO USA

PostPosted: Sat Aug 27, 2005 5:43 am     Reply with quote

Try something like:
Code:
<span class="bottomlink">
<script language=javascript>
<!--
var contact = "Comments/Suggestions"
var email = "info"
var emailHost = "netmagik.com"
document.write("<a href=" + "mail" + "to:" + email + "@" + emailHost+ ">" + contact + "</a>" + ".")
//-->
</script>
</span>
iblum



Joined: 22 Aug 2005
Posts: 5

PostPosted: Sat Aug 27, 2005 6:20 am     Reply with quote

I tried it, but it didn't work.
Corey Bryant
Site Admin


Joined: 15 May 2004
Posts: 8748
Location: Castle Pines North, CO USA

PostPosted: Sat Aug 27, 2005 6:58 am     Reply with quote

Post your CSS code for the bottomlink class
gary.newelluk



Joined: 12 May 2005
Posts: 552
Location: Inverurie, Scotland

PostPosted: Sat Aug 27, 2005 10:33 am     Reply with quote

Do all your links follow the same style? If so do they use a class?

You can specify the class within the <a> tag as follows:

Code:

document.write("<a class=\"bottomlink\" href=" + "mail" + "to:" + email + "@" + emailHost+ ">" + contact + "</a>" + ".")

iblum



Joined: 22 Aug 2005
Posts: 5

PostPosted: Sat Aug 27, 2005 10:55 am     Reply with quote

It worked!
Thanks again for your help.

Irina
Display posts from previous:   
Post new topic   Reply to topic    HTML Help Forum -> CSS All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
HTML Help Archive
Powered by phpBB © 2001, 2005 phpBB Group
HTML Help topic RSS feed 

 
DARFUR
HOSTING / DESIGN
MAKE MONEY

Home
  |   Tutorials   |   Forum   |   Quick List   |   Link Directory   |   About
Copyright ©1997-2002 Idocs and ©2002-2007 HTML Code Tutorial