Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Get the information a specific HTML tag carries
Old 08-30-2008, 12:32 PM Get the information a specific HTML tag carries
Junior Talker

Posts: 1
Trades: 0
Hello,

I'm working on a project, which requires some tasks to be accomplished in JavaScript. Sadly enough, I have no JavaScript experience.

Well, I'm trying to send over to .js two variables. Sending the first one works great. The second variable is related to <option> tag (see the code below) and cannot be put elsewhere (in the original program that part of the code is in a loop). I found that "this.value" outputs content of value attribute, but the second variable cannot be put into value attribute, because value is already occupied with some other vital content. I was trying to put it into title, class attributes, but "this.title" and "this.class" didn't work. Where should I put that final variable?

HTML Code:
<select onchange="exchange(<?php echo $one ?>,this.title)">
<option value="vital" title="$second">Some text</option> <!-- putting it into title doesn't work... -->
</select>
I hope I described the problem well enough so that someone could help me solve it. Thank you in advance!
ech0 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-30-2008, 03:43 PM Re: Get the information a specific HTML tag carries
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,528
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
the option element does NOT have an attribute of title or a class attribute. The data will have to be in the value attribute separated by some form of delimiter so the individual data values can be parsed out by the receiving function
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to Get the information a specific HTML tag carries
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.09803 seconds with 12 queries