jQuery Multiple choices


Total available count: 24
Subject - JavaScript Frameworks
Subsubject - jQuery

Look at the following selector: $(":disabled"). What does it select?


 

 

 

 



A


Solution:-

The :disabled selector selects all disabled form elements.

For disabled selector syntax is as follows:
$(":disabled")

For disabled selector example is as follows:

<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
 $(":disabled").css("background-color", "red");
});
</script>
</head>
<body>

<form action="">
Name: <input type="text" name="user"><br>
ID:<input type="text" name="id" disabled="disabled">

Age:
<select disabled="disabled">
 <option>20-30</option>
 <option>30-50</option>
 <option>50+</option>
</select>
<input type="submit">
</form>

</body>
</html>

 




Next 2 multiple choice(s)

1

Which jQuery method returns the direct parent element of the selected element?

2

The jQuery animate() method can be used to animate ANY CSS property?

Comments