Javascript Question and Answer

Javascript Question and Answer
1. <script type="text/javascript">
x=4+"4";
document.write(x);
</script>
Output------?
  • 44
  • 8
  • 4
  • Error output
Show Answer
2. <script type="text/javascript" language="javascript">
var qpt = "Qualiyt Point Technologies";
var result = qpt.split(" ");
document.write(result);
</script>
  • Quality
  • Q,u,a,l,i,t,y,P,o,i,n,t,T,e,c,h,n,o,l,o,g,i,e,s
  • Qualiyt,Point,Technologies
  • QualityPointTechnologies
Show Answer
3. Is it possible to nest functions in JavaScript?
  • True
  • False
Show Answer
4.  <script>
document.write(navigator.appCodeName);
</script>
  • get code name of the browser of a visitor
  • set code name of the browser of a visitor
  • None of the above
Show Answer
5. Which of the following is true?
  • If onKeyDown returns false, the key-press event is cancelled.
  • If onKeyPress returns false, the key-down event is cancelled.
  • If onKeyDown returns false, the key-up event is cancelled.
  • If onKeyPress returns false, the key-up event is canceled.
Show Answer
6. Scripting language are
  • High Level Programming language
  • Assembly Level programming language
  • Machine level programming language
Show Answer
7. Which best explains getSelection()?
  • Returns the VALUE of a selected OPTION.
  • Returns document.URL of the window in focus.
  • Returns the value of cursor-selected text
  • Returns the VALUE of a checked radio input.
Show Answer
8. <script language="javascript">
function x()
{
var s= "Good 100%";
var pattern = /\D/g;
var output= s.match(pattern);
document.write(output);
}
</script>
  • Good %
  • 1,0,0
  • G,o,o,d,%
  • Error
Show Answer
9. <script language="javascript">
var qpt="QUALITY POINT TECHNOLOGIES";
alert(qpt.charAt(qpt.length-1));
</script>
  • P
  • E
  • S
  • Error
Show Answer
10. Choose the client-side JavaScript object:
  • Database
  • Cursor
  • Client
  • FileUpLoad
Show Answer
Questions and Answers for Competitive Exams Various Entrance Test