INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

HTML5 hidden attrbibute not working IE11

HTML5 hidden attrbibute not working IE11

(OP)
Hi,

I had read that you can hide select list options cross browser with the hidden attribute and IE11 supports this.

However, I can't get it to work?

Does IE11 support this?

I am using JQuery to apply it..

CODE

$('#position option[value="R"]').attr('hidden','hidden'); 

I have tried using the property method

CODE

$('#position option[value="R"]').prop('hidden',true); 

But that doesn't work either and just adds the hidden attribute with an empty value anyhow?

Any ideas?

Thanks,

1DMF

"In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Free Electronic Dance Music

RE: HTML5 hidden attrbibute not working IE11

Hi 1DMF,
found this on w3schools site

Link

Might be of help, but I am still learning jQuery myself


Steve
Datamasher

RE: HTML5 hidden attrbibute not working IE11

Quote (1DMF)

However, I can't get it to work?

Does IE11 support this?

Does it work if you add it manually to the source code?

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum

RE: HTML5 hidden attrbibute not working IE11

(OP)
Nope sad

CODE

<select>
<option>1</option>
<option hidden="hidden">2</option>
<option>3</option>
</select> 
IE11 = 1,2,3
FireFox 36 = 1,3
Chrome 40 = 1,3
Opera 27 = 1,3

Looks like contrary to its reported support, it doesn't?

In the end I had to re-factor the entire functionality to physically remove or add the options dynamically using JQuery.

Was a royal pain in the behind as that's the old school (we don't do that anymore) non-HTML5 way of doing it!

"In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Free Electronic Dance Music

RE: HTML5 hidden attrbibute not working IE11

Quote:

Looks like contrary to its reported support, it doesn't?

Pretty much.

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum

RE: HTML5 hidden attrbibute not working IE11

I am wondering why you want to hide values in an option control.

Keith
www.studiosoft.co.uk

RE: HTML5 hidden attrbibute not working IE11

(OP)

Quote:

I am wondering why you want to hide values in an option control.

Because there are multiple selects with a range of possible values that alter dependent on each others selection.

It's nice and easy to simply add or remove either display:none via an applied or removed class or the hidden attribute (one assumes the reason why it was added to the specification).

Hey ho, such is life, nice idea, if it worked cross-browser!

"In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Free Electronic Dance Music

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close