About document.getElementID? Explain giving one example.

This was asked by a interviewer when i said that i know
some JavaScript.

Answer Posted / kishore.gsgs

using this u can access any html elements by its id.Here we
are going to access <input> textbox by its id("abc").when we
click on
submit button javascript execute and <tr> will not be displayed
<html>
<head>
<script type="text/javascript">

function change()
{
alert("success");
alert(document.getElementById("kishore").value);
}
</script>

</head>
<body>
<input type="text" id="kishore">
<input type="button" name="submit" value="submit"
onClick="change()"/>
</body>
</html>

Is This Answer Correct ?    7 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the difference between “==” and “===”?

527


Explain equality operators in javascript?

531


What is a null variable?

547


all possible test cases for normal number field,name field date field,check box,

946


How to write hello world on the web page?

521






Consider the following code: 1 2 3 4 5 (function() { var a = b = 5; })(); console.log(b); what will be printed on the console?

479


Hello Friends !!! I am RAJAT AGRAWAL, All Saints' College of Technology, Bhopal ( M.P. ) I just want to share my experience of getting placed at Consagous Technologies. On 9th June 2012 there was an close campus drive of Consagous Technologies in our college. I was very excited to take part in it. Firstly, they started with a seminar, a small introduction about the company. Then the placement process started. The recruitment process of Consagous had three rounds. 1. Written test 2. Group discussion 3. Technical interview & HR Interview Written Test : It was objective type with 50 questions in 60 mins. The written test paper had three sets set A , set B and set C. I got set B. Basically the question were from network connection with database ,output of programs on C, C++, java, asp.net, php , data structure and Aptitude questions included topics like Time & Distance, simple interest ,average, Percentage, Ratio & Proportion etc.There was no negative marking in the written test. Some of them which I remember are- 1. What command in UNIX run on backgroung. 2. The groups of students are divided into 2class room. If 10students are shifted from class A to Class B then no of students in both class are equal. If 10 Students are shifted from class B to Class A then no of students in class A is Double to the no of students in Class B. Find the total no of students? 3. The time taken by boat to travel 4 meters dowmstream is 4 hours 48 min and that the upstream 4 hours .Find the speed of the boat in still water and the speed of the stream. 4. And many more…. Then after few hours the result of written test was announced , and fortunately I was selected among the 80- 100 other students. After written test 21 students were shortlisted and went through 2nd round . GD Round: In this round , all 21 students divided into two teams and went through group discussion process. Topic of our GD was “Spirituality and Technology” and it held for 15 to 20 min. It was the very nice discussion and most of them took part in it. After GD round 11 students were shortlisted. Then the next round was Technical and HR interview. HR and Technical Interview: Finally after 2nd Round I had been selected for HR and Technical Interview Round .At that time also I was full of excitement for my PI , though nervous also. I just prayed to God , took my parents name and entered in the room, As I entered I saw three people there inside the room I wished all of them, and they offered me the chair, I replied with thank you sir thank you mam. HR questions: • Introduce yourself • Why u want to be a software engineer? • why u want to join consagous? • Why do we take you in consagous? • Tell me 5 negative points of your's? • Tell me the name of CEO of Google, Facebook? Technical question: • what is object –oriented programming? • Tell me about your major project? • Features of OOPS n Advantage of Oops? • Difference between Router $ Switch? And many more…… All you have to be confident and have positive attitude during the interview. Really it was a very good experience with HR sir and with his team. And just after half an hour the results had been declared , 5 students were selected and fortunately with God Grace I was one of them, that was one of the most cherishable moment of my life. After that we have a photograph with HR Sir & CEO Sir. I always remember one thing We Will..... Do It...........!!!!! I would like to thank Consagous Technologies to give me such a big opportunity to work with them,thank you so much.!

2380


How host objects are different from native objects in javascript?

510


What is the best ide for javascript development?

479


How to count the number of element in an array using javascript?

557


How is javascript different from java?

474


Define anonymous function.

534


What is the difference of "settimeout" function and setinterval functions in javascript

579


What is the difference between local storage & session storage?

479


Is javascript enabled on chrome?

470