[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

Anyone here that knows JS well?

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 20
Thread images: 1

File: aud.jpg (145KB, 800x1199px) Image search: [Google]
aud.jpg
145KB, 800x1199px
I was wondering if you could comment this code for me so i know exactly what's happening on every line.

<div class="dropdown">
<button onclick="myFunction()" class="dropbtn">Dropdown</button>
<div id="myDropdown" class="dropdown-content">
<a href="#home">Home</a>
<a href="#about">About</a>
<a href="#contact">Contact</a>
</div>
</div>

<script>
/* When the user clicks on the button,
toggle between hiding and showing the dropdown content */
function myFunction() {
document.getElementById("myDropdown").classList.toggle("show");
}

// Close the dropdown if the user clicks outside of it
window.onclick = function(event) {
if (!event.target.matches('.dropbtn')) {

var dropdowns = document.getElementsByClassName("dropdown-content");
var i;
for (i = 0; i < dropdowns.length; i++) {
var openDropdown = dropdowns[i];
if (openDropdown.classList.contains('show')) {
openDropdown.classList.remove('show');
}
}
}
}
</script>
>>
>>62266063
It's already commented retard
>>
>>62266589
They commented what the chunk of code does, i wanted someone to comment what each individual line is doing, to help me understand how the code works
>>
>>62266698
So go ask them fucking newfag
>>
>>62266747
He can't. OP probably got the job saying he knows JavaScript, now he's got something to do with JS and can't.
>>
>>62266063
>>62266063
>>62266063
Testing
>>
>>62266915
>>62266915
>>62266063
>mfw 4chan doesn't allow you to run script tags
>mfw I have no facehttps://pastebin.com/QtJNhAis
Anyway here it is:
>>
>>62266939
Thanks anon, if you dont mind; what are some good websites/books to learn web development from and approx how long does it take to learn html,css and js to a competent level?

>>62266831
Actually just learning html and css in my free time via script kitty various sources. Doing it i have got a pretty clear idea of how html works, able to do my own basic websites. I guess because its very clear e.g color: green. but with java i simply cant read and understand. Guess im going to need to take a course or something
>>
>>62267053
>script kitty
>>
>>62266698
I have never even written a line of Javascript but knowing Java and C++ each line seems pretty fucking obvious. Do you know any programming language at all?
>>
>>62267194
I mean. Id just look at say 15 websites source codes, read through them and then go about creating something of my own through using elements of them. Now i undetstand basic html/css concepts due to doing that. I can create my own webite in html/css without looking at others code.

With js i can't, when i read it i cant understand it, its a more complex language. I plan to learn it, via books and online courses i was just asking the other anon for recommendations
>>
>>62267258
Nope. I plan to learn web languages as my first set. Then move onto vb. After i have learnt those few, c# and java.
>>
>>62267365
>first i will learn a, then b and then c because i think c is very hard

This is the worst [g/hackforums/generic tech board] meme ever. Just fucking learn what you want to learn.
>>
>>62267365
That explains a lot. Just do a few programming courses, be it online or at university. Don't expect that you'd know anything 3 months from now even doing those. It's like going to the gym, results take time.
>>
>>62267365
i hate how everyone thinks the essence of learning to program is learning a language
>>
>>62268486
What is the essence?
>>
>>62268817
Math and logic
>>
>>62267365
This has nothing to do with knowing anything "well".

Assuming you're not a troll, there is a web dev general, just look at the first fucking links in there, and quit expecting people to spoonfeed you.

If you think you have any fucking clue about the thing your asking about, there is a stupid questions general.

I've managed to keep expletives out of here, but hey, OP, fuck you, you fucking mental flatliner.
>>
I learned how to program in an IDE. Never used a text editor and compiler before. I got vim now which compiler do I use for c++? How do I compile? How do I debug?
>>
A thread died for this trash.
Thread posts: 20
Thread images: 1


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.