Download Android App in your Android Device from Google Play Store
- Search for "Withoutbook Practice Exam Test" in Mobile/Tablet Play Store
Practice InterviewNew Search by Name or Email

Exams Attended

Make Homepage

Bookmark this page

Subscribe Email Address

JavaScript Interview Questions and Answers

Ques 56. To set all checkboxes to true using JavaScript?

Ans. //select all input tags
function SelectAll() {
var checkboxes = document.getElementsByTagName(\"input\");
for(i=0;i if(checkboxes.item(i).attributes[\"type\"].value == \"checkbox\") {
checkboxes.item(i).checked = true;
}
}
}

Is it helpful? Add Comment View Comments
Ques 57. What is === operator?
Ans. ==== is strict equality operator ,it returns true only when the two operands are having the same value without any type conversion.
Is it helpful? Add Comment View Comments
Ques 58. How to disable an HTML object?
Ans. document.getElementById(\"myObject\").disabled = true;
Is it helpful? Add Comment View Comments
Ques 59. To write messages to the screen without using \"document.write()\"?
Ans. Changing the contents of an element is a much better solution. When the method showStatus is invoked it will change the content of the span.
...
function showStatus(message) {
var element = document.getElementById(\"mystatus\");
element.textContent = message; //for Firefox
element.innerHTML = message; //for IE (why can\'t we all just get along?)
return true;
}
...
<span id=\"mystatus\">Test. </span>
...
Is it helpful? Add Comment View Comments

Most helpful rated by users:

©2018 WithoutBook