Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8292421
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T13:28:38+00:00 2026-06-08T13:28:38+00:00

In the web page, I have some codes like <span commandArgument=a>A</span> <span commandArgument=b>B</span> I

  • 0

In the web page, I have some codes like

<span commandArgument="a">A</span>
<span commandArgument="b">B</span>

I want to use javascript to get the commandArgument values of the spans, and the code I wrote is

var spans = document.getElementsByTagName("span");
var value = spans[0].commandArgument;

It works in IE but fails in Firefox.
IE gets value = “a” and Firefox gets value = undefined.
Is there any method to get the values that works in both browser? Thanks!!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T13:28:40+00:00Added an answer on June 8, 2026 at 1:28 pm

    You can use the getAttribute() from the methods of the DOM element.

    This method works in old browsers as well according to the compatibility sheet of quirskmode.org

    var value = spans[0].getAttribute('commandArgument');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a web HTML page with some client-side JS codes based on dojox.charting.
I'm trying to make an adaptable Web page where I have some circles on
On extracting some html from a web page, I have some elements containing text
I have to render some text to a web page. The text is coming
I have a web page that prompts for user input via DropDownLists in some
I have a web page with a read-only text box which shows some HTML
I have an ActiveX object which extends some functions. I have a web page
We have a Web application (ASP.NET) which displays in some page links to miscellaneous
In my Default.aspx web page i use the following code in order to save
I do have some strings that contains programming code, like XHTML (asp.net markup), C#,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.