Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 09-05-2006, 12:09 PM   PM User | #1
vkkumar
New to the CF scene

 
Join Date: Sep 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
vkkumar is an unknown quantity at this point
Exclamation Span Tag ID Manipulation . . . Help Needed

I have a span tag on my page . . .

<span id="subTotal1">0.00</span>

I need to change the "id" name on the fly or dynamically on an "onChange()" event.

Can anyone help me on this . . . .

Can I use Normal Javascript & DOM as well?


Thanks in Advance
vkkumar is offline   Reply With Quote
Old 09-05-2006, 12:32 PM   PM User | #2
vwphillips
Senior Coder

 
Join Date: Mar 2005
Location: Portsmouth UK
Posts: 4,358
Thanks: 3
Thanked 458 Times in 445 Posts
vwphillips is a jewel in the roughvwphillips is a jewel in the roughvwphillips is a jewel in the rough
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<html>

<head>
  <title></title>
<script language="JavaScript" type="text/javascript">
<!--

function Ck(obj,nme){
 alert(obj.id);
 obj.id=nme;
 alert(obj.id);
}
//-->
</script></head>

<body>
<span id="subTotal1" onclick="Ck(this,'fred');" >0.00</span></body>

</html>
__________________
Vic

God Loves You and will never love you less.

http://www.vicsjavascripts.org.uk/

If my post has been useful please donate to http://www.operationsmile.org.uk/
vwphillips is online now   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:35 PM.


Advertisement
Log in to turn off these ads.