In Feburary 2016 25,
Open a text editor and create a new file named fillForm.html. Add some HTML tags to the file that include an open '
' tag, an open '
' tag, a closing '
' tag, an open '
' tag, a closing '
' tag, and a closing '
' tag. Together, these tags implement a basic HTML page.
Add a '
Add a JavaScript function between the '' tags. Name the function fillForm() and include an open curly brace '{' and a close curly brace '}' to indicate where to place the function's code.
Edit the fillForm() function and use a getElementById JavaScript function to set the value of the input field with the id value 'formToFill' to the text 'Changed Value'.
Type a '' tag and save fillForm.html.
Add a '
' HTML tag to the file and add an onClick() event to the button that calls the fillForm() function. Set the button's text to 'Click to change the value in the formToFill input field.'. Close the '
' tag and save and close fillForm.html.
Open the file in a web browser and click the button to change the text in the form field from the text 'Original Value' to 'Changed Value'.
In Feburary 2016 25,
Showing posts with label JavaScript. Show all posts
Showing posts with label JavaScript. Show all posts
Thursday, 25 February 2016
Monday, 1 February 2016
How to Include Java Script on All Pages in WordpressIn Feburary 2016 01,
In Feburary 2016 01,
Upload your JavaScript file in your theme's folder via an FTP client.
Log on to your WordPress site and click on 'Appearance' and 'Editor.'
Select 'Header' from the list of templates on the right.
Insert the script to include your JavaScript file within the
section of the template:Replace 'pathto/yourscript.js' to the location of your JavaScript file.
Click on 'Update File.'
In Feburary 2016 01,
Upload your JavaScript file in your theme's folder via an FTP client.
Log on to your WordPress site and click on 'Appearance' and 'Editor.'
Select 'Header' from the list of templates on the right.
Insert the script to include your JavaScript file within the
section of the template:Replace 'pathto/yourscript.js' to the location of your JavaScript file.
Click on 'Update File.'
In Feburary 2016 01,
Labels:
Appearance,
click,
Editor,
file,
Header,
JavaScript,
Log,
select,
site,
WordPress
Subscribe to:
Comments (Atom)