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 7001687
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T20:50:06+00:00 2026-05-27T20:50:06+00:00

if i run the same code for IE every thing is fine i am

  • 0

if i run the same code for IE every thing is fine i am getting the value of selectedId where as for firefox and chrome it is giving values Undefine.

----------------- code -------------------------------

<html>
<head>
<script type="text/javascript">

function createSelected()
{
var value;
var theForm = document.hell;

for (var i = 0; i < theForm.length; i++)
{
var e = theForm.elements[i];
if ((e.type == "hidden") && (e.value == "false"))
{
       console.log("the value of selected IDS="+e.selectedId);
    if (e.selectedId!= undefined )
    {   
        Value = ", "+e.selectedId;

    }
}
}
console.log( Value);
}


</script>
</head>
<body>
<form name="hell">

<h1>This working only with IE not with FireFox and Crome  </h1>
<br/>
<br/>
<input type="hidden" selectedId="heyya1"  name="item1" value="false">h1</input>
<input type="hidden" selectedId="heyya2"  name="item2" value="false">h2</input>
<input type="hidden" selectedId="heyya3"  name="item3" value="false">h3</input>
<input type="hidden" selectedId="heyya4"  name="item4" value="false">h4</input>
<input type="hidden" selectedId="heyya5"  name="item5" value="false">h5</input>
<input type="hidden" selectedId="heyya6"  name="item6" value="false">h6</input>
<input type="button" onclick=createSelected() value="find the values"></input>
</form>


</body>

---------------------------code end-----------------------------------------

please help in in this why cant we use other parameter( like Selectedid inside HTML tag) in FireFox like we can do it in IE.

thanks in advance..

  • 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-05-27T20:50:07+00:00Added an answer on May 27, 2026 at 8:50 pm

    In Chrome (sorry, I’m using a computer that doesn’t have FF, and I’m not going to install it just for this question) it works if you use .getAttribute(). So:

    // replace
    e.selectedId;
    // with
    e.getAttribute("selectedId");
    

    Or, in your function:

    var id = e.getAttribute("selectedId");
    console.log("the value of selected IDS="+id );
    if (id != null)
    {   
        value += ", "+id;
    }
    

    Also, note that JavaScript is case sensitive, so your variable value is not the same as Value, and you were saying Value = where you probably meant value +=. And you may want to use quotes around your element attributes: onclick="createSelected()".

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can I run ASP.NET 2.0 and 3.5 code on the same website? ...or, do
Well, this question refers directly to windows 7. I run the same code on
Is there any way to run one same instance of JavaCcript(jQuery) on the server
What I'm trying to do is run the same SQL select on many Oracle
It appears m2eclipse is not recognizing my $M2_OPTS variable. I can run the same
I always run into the same problem when creating web pages. When I add
I've run into the same problem as found in this question . However, I
Is solr a web application that can run on the same instance as a
I have two scripts that often need to be run with the same parameter:
I am creating a portal where many sites will run of the same MVC

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.