Web development Basics
JavaScript Interactions and HTML
JavaScript can read, change, and control HTML elements after the page loaded
(HTML creates the page, JavaScript modifies the page dynamically).
How does JavaScript interact with HTML?
JavaScript uses something called the DOM
(The Dom represents the HTML page as objects that JavaScript can access and modify)
Common things JavaScript Does with HTML
Read input values, change text, change styles, Show/hide elements. respond to user actions, update page without reload
Task1: Display the ID value
index.html
Output: As you see here document.getElementById("btn").innerText
it will show the value of the ID
PS C:\Users\Administrator\Desktop\CCIT\PythonCourse\Day32> start index.html
document.getElementById("lblName").innerText
it will show the value of the ID, for This change, it will show the Employee Name
3.
If you change above , you can override the label value to Welcome to ccit
Task2: For this task, what every the text you have enter the value when click display alert for that value
Above code is same just change below line
Output:
Task3:Style,Show hide text box
index.html
Output:
PS C:\Users\Administrator\Desktop\CCIT\PythonCourse\Day32> start index.html
When Click Hide Button
When click Show button
Task3: showpop
index.html
Output:
When click TryIt, shows popbox click Ok, text will display , when cancel , cancel text will display.
Introduction to AJAX
Asynchronous JavaScript and XML
AJAX Sending and Receiving data
--Thanks
No comments:
Post a Comment