R4R
Right Place For Right Person TM
R4R HTMLDOM FAQS HTMLDOM Interview Questions and Answers

 


Totel:17 Click: 1 2 3 4

HTMLDOM Interview Questions And Answers

Page 1

Questions 1 How to changed font and color of an text element?

Answer
I have given you example using them you can change font and text of an element by using a function. Example: <html> <head> <script type="text/javascript"> function ChangeText() { document.getElementById("welcome").style.color="red"; document.getElementById("welcome").style.fontFamily="Times New Roman"; document.getElementById("welcome").style.fontSize="20"; } </script> </head> <body> <p id="welcome">R4R Welcomes You!</p> <input type="button" onclick="ChangeText()" value="When you click on button text font and color will change"> </body> </html>

Questions 2 Using function how to change the background color?

Answer
I have given you example which shows you how to change background color by using function. <html><head><script type=\"text/javascript\">function ChangeBackground(){document.body.style.backgroundColor=\"pink\";}</script></head><body><p id=\"welcome\">R4R Welcomes You!</p><input type=\"button\" onclick=\"ChangeBackground()\"value=\"When you click on button than background color will changed.\"></body></html>

Questions 3 How to change the text of an element with a function?

Answer
I have given you example in which I changed the text of an element by using an function. In this example text has been changed when you execute function. Example: <html> <head> <script type="text/javascript"> function ChangeText() { document.getElementById("welcome").innerHTML="R4R Welcomes You!"; } </script> </head> <body> <p id="welcome">Hello User!</p> <input type="button" onclick="ChangeText()" value="When you click on button text will changed"> </body> </html>

Questions 4 How to change the text of an element?

Answer
I have given you a scipt code using them you can change the text of an HTML element.Now, In example that I have shown below we change the text of the element <p>. Example: <html> <body> <p id="welcome">R4R Welcomes You!</p> <script type="text/javascript"> document.getElementById("welcome").innerHTML="A new message from R4R"; </script> <p>R4R introduce a new service called VoiceBox using them you can chat with R4R.</p> </body> </html>

Questions 5 How to change the background color of an element?

Answer
I have given you a script code using them you can change the background color of elements of body. <html> <body> <script type="text/javascript"> document.body.bgColor="pink"; </script> <p>Now, Your background color is pink.</p> </body> </html>


Goto Page:

1 2 3 4
Share |

HTMLDOM Objective Questions And Answers

HTMLDOM Objective Questions And Answers

HTMLDOM Interview Questions And Answers

HTMLDOM Subjective Questions And Answers


R4R,HTMLDOM Objective, HTMLDOM Subjective, HTMLDOM Interview Questions And Answers,HTMLDOM,HTMLDOM Interview,HTMLDOM Questions ,HTMLDOM Answers

New Updates

R4R
R4R
R4R
R4R
R4R
R4R
R4R
R4R