Tag: dom

55 votes
17 answers
3K views
window.onload vs $(document).ready()

What are the differences between JavaScript's window.onload and jQuery's $(document).ready() method?

avatar
Tana
0 1 0 9
asked 07 September, 2021
52 votes
14 answers
3K views
How can I select an element by name with jQuery?

I have a table column I’m trying to expand and hide. jQuery seems to hide the <td> elements when I sel

avatar
Vi
0 1 0 9
asked 07 September, 2021
63 votes
30 answers
1.5K views
Get selected text from a drop-down list (select box) using jQuery

How can I get the selected text (not the selected value) from a drop-down list in jQuery?

avatar
Wilfredo
0 1 0 9
asked 07 September, 2021
55 votes
18 answers
2.1K views
.prop() vs .attr()

So jQuery 1.6 has the new function prop(). $(selector).click(function(){ //instead of: this.getAttrib

avatar
Yolando
0 1 0 9
asked 07 September, 2021
56 votes
30 answers
2.3K views
How can I change an element&apos;s class with JavaScript?

How can I change the class of an HTML element in response to an onclick or any other events using JavaScript?

avatar
Dorinda
0 1 0 9
asked 07 September, 2021
51 votes
14 answers
2.7K views
event.preventDefault() vs. return false

When I want to prevent other event handlers from executing after a certain event is fired, I can use one of tw

avatar
Vi
0 1 0 9
asked 07 September, 2021
56 votes
30 answers
2.5K views
How do I check if an element is hidden in jQuery?

Is it possible to toggle the visibility of an element, using the functions .hide(), .show() or .toggle()? How

avatar
Vi
0 1 0 9
asked 07 September, 2021
52 votes
30 answers
582 views
PHP random string generator

I'm trying to create a randomized string in PHP, and I get absolutely no output with this: <?php

avatar
Janella
0 1 0 9
asked 07 September, 2021