₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,329,666 members, 8,441,732 topics. Date: Thursday, 09 July 2026 at 03:24 AM

Toggle theme

Javascript Geeks Please Come In - Webmasters - Nairaland

Nairaland ForumScience/TechnologyWebmastersJavascript Geeks Please Come In (512 Views)

1 Reply (Go Down)

Javascript Geeks Please Come In by Tccomms(op):
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(op): 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

Google Adsense Gurus Please Come InNairalanders Please Come To My Rescue From DomainkingFacebook Ads Gurus Please come and save a bro234

Bitcoin Investment Gone WrongHelp Review We Africa Proud Wap.org.ngLooking For Someone To Help Build A Forum