Javascript MCQ
Javascript MCQ
JAVASCRIPT
1. JavaScript is a ....
A. static computer programming language B. Structured query programming language
C. dynamic computer programming language D. Procedural oriented programming language
2. Which one of the following is not server-side scripting language
A. PHP B. Pearl C. Python D. Javascript
3. JavaScript is a
A. client-side scripting language B. Server-side scripting language
C. structured query language D. Procedural oriented programming language
4. Javascript is mainly used for...
A. creating web browser B. Reading and writing files
C. storing data in the server D. Interaction with the user through web page
5. Who was developed JavaScript?
A. Brendan Eich B. BjameStroustrup C. Dennis M. Ritchie D. Brian W. Kernighan
6. In which year JavaScript was developed?
A. 1985 B. 1975 C. 1995 D. 1998
7. JavaScript‟s syntax was influence by....
A. C programming language B, procedure oriented language
C. prototype-based scripting language D. Event-driven programming language
8. JavaScript initially called as......
A. PHP B. Perl C. J Script D. Live Script
9. Which language‟s syntax was used in JavaScript?
A. C B. SQL C. COBOL D. Visual Basic
10. Which one is responsible to run JavaScript code?
A. Browser B. Compiler C. Interpretar D. Operating System
11. Which one of the following cannot be used to edit JavaScript code?
A. MS Excel B. Notepad++ C. Sublime Text D. Visual Studio Code
12. JavaScript is a ....
A. Case sensitive language B. coding sensitive language
C. regular sensitive language D. non-case sensitive language
13. Mocha was officially called ....
A. Ada B. Lisp C. Mucha D. LiveScript
14. What is the extension name of HTML program?
A. .js B. .hml C. .Lisp D. .html
15. It is better to segregate HTML and JavaScript files, so the segregated JavaScript file is called as ....
A. local JavaScript file B. global JavaScript file
C. internal JavaScript file D. external JavaScript file
16. JavaScript is a ....
A. static scripting language B. regular sensitive language
C. object based scripting language D. object oriented scripting language
17. What are the benefits to segregate HTML and JavaScript files?
A. It is easier to modify code B. The execution speed of program will be increased
C. The execution speed of program will be decreased
D. Changing HTML files will not affect JavaScript files
18. The extension file name of the external JavaScript file is ....
A. .js B. .ext C. .html D. .jext
19. We can import the JavaScript code file in HTML using ...
A. src attribute in script tag B. Ink attribute in script tag
C. link attribute in script tag D. jsLink attribute in script tag
20. Which one of the following is text editor?
A. Excel B. Word C. Notepad D. WordPad
21. Which method creates the following popup box in JavaScript?
372. Which of the JavaScript window method is used to resize the current window?
A. Resize ( ) B. Resize To ( ) C. Window.Resize ( ) D. Window.resizeTo( )
373. Which of the following Javascript property returns the with of the visitor‟s screen in pixels?
A. Width B. Scrren width C. screen.width D. Screen.avail width
374. Which of the following javascript property returns the height of the visitors screen in pixels?
A. Height B. Screen Height C. screen.height D. Screen.avail Height
375. Which of the following Javascript property returns the URL of the current page?
A. href B. <href> C. location.href D. Location href
376. In Javascript, the property location hostname returns
A. URL B. web protocol C. domain name D. path and file name
377. Which of the following Javascript method loads a new document?
A. Load ( ) B. Assign ( ) C. Location.Load ( ) D. Location.assign ( )
378. Which URL in the history list is loaded by the history back ( ) method of JavaScript?
A. NextURL B. Previous URL C. The very first URL D. The very last URL
379. Which URL in the history lint is loaded by the history, forward ( ) method of Javascript?
A. NextURL B. Previous URL C. The very first URL D. The very last URL
380. When we execute the following JavaScript code segment, What will be the output
var z = „He is my “Honourable” Teacher‟;
alert(z);
A. Honourable B. He is my Teacher
C. Honourable Teacher D. He is my “Honourable” Teacher
381. Which notation is used to write extra-large or extra small numbers?
A. Octal notation B. Binary notation
C. scientific notation D. Hexadecimal notation
382. JavaScript can access and modify all the elements of an HTML document with the help of
A. HTML B. HTML dom C. HTML tags D. HTML tags with a aributes
383. The browser creates a DOM of the page when a web page is
A. saved B. loaded C. opened D. down loaded
384. Which of the following is standard is the DOM?
A. W1C B. W2C C. W3C D. W4C
385. Which one of the following DOM is a standard model for all document types?
A. DOM B. XML DOM C. Code DOM D. HTML DOM
386. A property is
A. a standard model B. a defined element
C. an action you can do D. a value that you can get or set
387. An method is
A. a standard model B. a defined element
C. an action you can do D. a value that you can get or set
388. Which one of the following is a property in the given Javascript code?
document.getElementByld(“demo”).innerHTML = “Hellow world”)
A. demo B. document C. innerHTML D. getElement Byld
389. Which one of the following is a method in the given JavaScript code?
document.getElementByld(“demo”).inner HTML = “Hello words”)
A. demo B. document C. innerHTML D. getElementByld
390. The method document.remove child ( ) is used to
A. create HTML element B. add an HTML element
C. delete an HTML element D. replace an HTML element
391. The method document append child ( ) is used to
A. create HTML element B. add an HTML element
C. delete an HTML element D. replace an HTML element
392. Who is the owner of all the other objects in your web page?
A. Method B. Preperty C. Attribute D. Document object
393. The easiest way to find HTML elements in the DOM is by using the elements
A. id B. tag name C. class name D. HTML object
394. Which one of the following Javascript stements sets value to the HTML elements?
A. x.set attribute (“type”, “check box”);
B. var x = document.create Element(“INPUT”);
C. document.getByld(“txt 1”).innerHTML = x;
D. var x = document.getElementByld(“My Form”);
395. DOM is used to
A. access objects in the web page
B. create class automatically in the web page
C. create objects in the we page
D. change address of objects in the web page
396. Document.lastModified method returns...
A. all image elements B. date and time the document was updated
C. URI of document D. all<form>elements
397. Document.anchors method returns...
A. all <att> with a value in the name attribute
B. all<anchor> with a value in the name attribute
C. all<a> with a value in the name attribute D. all<all> with a value in the name attribute
398. In the following x represents..
document.getElementByld(„P1‟).innerHTML=”Govt.ITI CPT”;
x
A. object B. class c. Method D. Property
399. In the following x represents
document.getElementByld(„P1‟).innerHTML= “Govt.ITI CPT”;
x
A. Object B. class C. Method D. Property
400. Which one of the following JavaScript method removes focus from a submit button?
A. Blur() B., Focus() C. Select() D. Onclick()
401. What would be the output of the following JavaScript code segment?
var dist` = 12e3;
var dist2 = 12e-3;
alert(dist1 + “ “ + dist2);
A. 12e3 12e-3 B. 12000 0.012 C. 120e2 1.2e-2 D. 12000.0 0.012
402. Which one of the following javascript statement is used to access an input text object?
A. x.SetAttribute(“type”, “Input”);
B. document.get Element Byld (“My Text”);
C. Var x = document.createElement(“Input”);
D. Var x = document.get ElementByld (“My Text”);
403. What would be the output of the following JavaScript code segment?
var a = 12;
var b = 15;
alert(a == b);
A. false B. true C. NaN D. Undefined
404. Which one of the following Javascript statement creates a label object?
A. x.SetAttribute(“type”, “Label”);
B. document.get Element Byld (“My Label”);
C. Var x = document.createElement(“LABEL”);
D. Var x = document.get ElementBy ld (“My Label”);
405. In JavaScript, which of the following is used to store user information in web pages in client machine
as text files?
A. Arrays B. Applets C. Cookles D. Function
406. Which of the following Javascript property is used to create, read and delete cookies?
A. cookie () B. document.cookie
C. document.cookie.read D. document.cookie.create
407. Which of the following is a valid JavaScript statement to create a cookie?
A. cookie = user name = “copa iti” ;
B. cookie = user name = “COPA iti” ;
C. document.cookie = “username = copa iti” ;
D. document.cookie = “ username = COPA iti” ;
408. In the following x represents
document.getElementByld(„P1‟).innerHTML=”Govt.ITI CPT”;
x
A. Object B. Class C. Method D. property
409. Which of the following parameter in JavaScript is used to delete a cookie?
A. Erase B. Deletes C. expires D. remove
410. Which HTML tag is used to add image object?
A. <img> B. <image> C. <addimg> D. <add image>
411. Which is used to access an <img> element in JavaScript?
A. get Id ( ) B. Element ( ) C. get Element( ) D. getElementByld( )
412. Which of the following JavaScript image object property returns the original width of an image?
A. Width B. Height C. naturalwidth D. Naturalheight
413. Which of the following Javascript image object property returns the original height of an image?
A. Width B. Height C. Naturalwidth D. naturalheight
414. Which of the following Javascript method is used to create an image object?
A. document.Create ( ) B. document.Create (“img”);
C. document.CreateElement(Img); D. document.CreateElement(“Img”);
415. In XAMPP, „x‟ represents...
A. Perl B. My SQL C. Crossplatform D. ApacheHTPP server
416. In XAMPP, „A‟ represents...
A. Admin B. Applet C. Phpmy Admin D. ApacheHTPP server
417. In XAMPP, „M‟ represents
A. My SQL B. Ms word C. My Admin D. Phpmy Admin
418. Apache is
A. client application B. web server application
C. mail server application D. client server application
419. Which of the following is a database management system?
A. Perl B. PHP C. Apache D. MySQL
420. What is PHP?
A. Word processing software B. Client side scripting language
C. Server-side scripting language D. database management system
421. Which of the folloiwng is a high level programming language?
A. Perl B. PHP C. Apache D. My SQL
422. addEventListener() method attaches...
A. attaches an event handler to the specified element
B. attaches a property to the specified element
C. attaches a class to the specified element
D. attaches an object to the specified element
423. The official website for OpenCms is
A. http://www.opencms.org/en/ B. http://www.opencontentms.org/en/
C. http://www.opencmsystem.org/en/ D. http://www.opencontentmanagementsystem.org/en/
424. What is the full form of CMS?
A. Content Management System B. Content Managing System
C. Component Management System D. Content Management Software
425. The self executable file is...
A. ZIP B. EXE C. RAR D. DOC
426. Which of the following is a compressed file format?
A. ZIP B. EXE C. DOC D. HTML
427. Which is a standard network protocal used to transfer computer files from one host to another host
over internet?
A. IP B. FTP C. HTTP D. SMTP
428. A full-featured FTP client can be run with in firefox in the form of an extension called
A. FTP B. FoxFTP C. FireFTP D. FirefoxFTP
429. Which one of the following open source software is used to upload or download from client to server
and vice versa?
A. PHP B. Perl C. HTTP D. FILEZILLA
430. The expansion of SRS is
A System Resource Settings B. System Requirement Settings
C. System Resource Specification D. Software Requirement Specification
431. Which of the following is important before development of any system or project?
A. SRS B. Date C. Form D. Repot
432. The expansion of SDLC is
A. System Design Life Chart B. System Design Life Cycle
C. System Development Life Chart D. Systems Development Life Cycle
433. A sequence of stages in which the output of each stage becomes the input for the next. Name the
model
A. Water fall B. Synchronize C. Build and fix D. Rapid prototyping
434. At which stage of SDLC, code is written?
A. Testing B. Development C. System design D. Requirement definition
435. The first phase of SDLC is
A testing B. Development C. Planning D. requirement definition
436. The standard interfaces provided by a browser for interaction with program script is called
A. Browser Object Model B. Browser Opening Model
C. Brown Object Model D. Browser Object Mission
437. OpenCms is a
A. open source software B. testware
C. malware D. firmware
438. All HTML elements are defined as
A. Objects B. property C. methods D. events
439. document.form returns...
A. URL B. elements C. browser D. all form elements
440. What is the four primary component of XAMPP?
A. Cross-Platform, Apache, MySQL, PHP, Perl
B. Oracle, MySql, Pearl, PHP
C. Filezilla, Apache, PHP, JavaScript
D. AutoCad, PHP, MySql, Pearl
441. Which one is support provided for various components of a HTML document (like head, title, body,
etc) in a browser is called
A. Document Object Model B. Domain Object Model
C. Document Office Model D. Document Object Management
442. Methods of DOM (Document Object Model) are called on object\
A. document B. window C. button C. text
443. innerHTML property is used to
A. delete content of object B. add content to object
C. delete the object D. change the content of object
444. Cookie may have „expires‟ property which contains
A. name of owner B. date and time of expiry
C. name of browser D. name of the web server
445. document.body returns
A. <body> element B. <html> element
C. <form> elements D. DOM configuration
446. document.URL returns
A. URL B. elements C. browser D. configuration URL
447. The full form of TOC is
A. time of content B. table of contents
C. text of content D. termination of content
448. Which data type is hold in Array index?
A. number B. string C. either number or string
D. neither number nor string
449. What would be the value stored in name[3]?
var name=newArray(“Krish”,”Ram”,”Shiva”,27)
A. Krish B. Ram C. Shiva D. 27
450. Any variable declared inside a function has validity within the
A. block only B. function only C. global scope D. constant