Ans)
💻 Code 🪄 Live Preview
Hint: By using prompt box enter two numbers then print higher number by using alert box.
Ans)
💻 Code 🪄 Live Preview
Hint: Take an input from textbox and print result in another textbox. Formula: 1KM=1000 M
Ans)
💻 Code 🪄 Live Preview
Hint: Take an input from textbox and print result in textarea.
Ans)
💻 Code 🪄 Live Preview
Hint: Take an input from textbox and print result in another textbox on button’s click. Ex: Input: 123 Output: 321
Ans)
💻 Code 🪄 Live Preview
Hint: Take two textboxes for getting inputs for calculation and take one textbox to display Result. Take four buttons for operations like + , - , * and /. It looks like as:-
Ans)
💻 Code
🪄 Live Preview
(a)
* * * * * * * * * * * * * * *
(b)
* * * * * * * * * * * * * * *
Ans)
💻 Code 🪄 Live Preview
Hint: Read content of div and write some content in div by using JS. Take two buttons one is for reading the content of div and another button is for writing the content in div tag.
Ans)
💻 Code
🪄 Live Preview
Q2.2)
Create an HTML page to show or hide a div tag also create a button to print the content of page.
Hint: Take two anchor tags one is for hiding the div and another anchor tag is to make it visible.
Ans)
💻 Code
🪄 Live Preview
Ans)
💻 Code
🪄 Live Preview
Q2.4)
Create an HTML page. Add some content to It. Create a button with text Open Popup
. On button click display the modal. Add a button in Modal with text Close Popup
. On button click hide the modal.
Ans)
💻 Code
🪄 Live Preview