Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,154,677 members, 7,823,914 topics. Date: Friday, 10 May 2024 at 06:09 PM

Javascript Geeks Please Come In - Webmasters - Nairaland

Nairaland Forum / Science/Technology / Webmasters / Javascript Geeks Please Come In (408 Views)

Nairalanders Please Come To My Rescue From Domainking / Please Come In Portharcourt Webmasters / Website Geeks Get In Here! (2) (3) (4)

(1) (Reply) (Go Down)

Javascript Geeks Please Come In by Tccomms: 12:08pm On May 21, 2021
Please I'm trying to achieve something. I have this lines of js that disables a select ion option like this

<select>
<option>A</option>
<option class="disable" >B</option>
<option>C</option>
<option class=" disable">Door</option>
</select>

Then the JS is
let elements = document.getElementsByClassName("disable"wink;
doIt(elements, true);

function doIt(elements, status){
for(var i =0; i < elements.length; i++){
elements [i].disabled = status;
}
}

Following the same method using array and class how can I achieve hiding the options with the class name disable
Re: Javascript Geeks Please Come In by Jas80: 4:24pm On May 22, 2021
Tccomms:
Please I'm trying to achieve something. I have this lines of js that disables a select ion option like this

<select>
<option>A</option>
<option class="disable" >B</option>
<option>C</option>
<option class=" disable">Door</option>
</select>

Then the JS is
let elements = document.getElementsByClassName("disable"wink;
doIt(elements, true);

function doIt(elements, status){
for(var i =0; i < elements.length; i++){
elements [i].disabled = status;
}
}

Following the same method using array and class how can I achieve hiding the options with the class name disable


Are you talking about hiding the elements?, Something like visibility hidden or display none?
Re: Javascript Geeks Please Come In by Tccomms: 12:36am On May 23, 2021
Jas80:


Are you talking about hiding the elements?, Something like visibility hidden or display none?

Yes I was
Thanks for responding but I have gotten the solution
Re: Javascript Geeks Please Come In by Jas80: 10:17am On May 23, 2021
Tccomms:


Yes I was
Thanks for responding but I have gotten the solution
No issue bro, u r welcome
Re: Javascript Geeks Please Come In by Dujardin(m): 8:56am On May 25, 2021
Post what you did right, your question and answer may help someone in the future. Think stackoverflow grin

Tccomms:


Yes I was
Thanks for responding but I have gotten the solution

(1) (Reply)

What's Your Advise? Please Help / / We Are Open For ADX And Adsense Account Partnership

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 13
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.