How to write your first javascript without any Experience
how to write our first javascript
you can write your javascript inside this script track your scripture can be placed everywhere within the html check but you are recommended to keep the script tag within the head track okay the script track may contain two important attributes
their language and type first we will talk about the language to the opening of the script tag you can show the language as javascript but it is not compulsory as it phased out with the development of new versions of html it can be written as language equals quotation mark javascript quotation mark
next we will learn about the type this attribute indicates
the scripting language news which identifies the content between the script tag the type attribute can be written as shown here type equals quotation mark text slash javascript quotation mark as the text slash javascript became outdated it had replaced with the application slash javascript so it can be written as type equals quotation mark application slash javascript quotation mark however the type out of which is optional upon the introduction of html5 so in short both the adwords language and type are optional in the new versions of html now we will write our first javascript with document.write we have here the document dot right then inside the round brackets and quotation marks we have hello friends wow congratulations we wrote our first javascript successfully let's try one more thing type here function then type any function name followed by the round brackets we will set this alert message your payment has been sent successfully inside the body tag we have here the input tag the type is button next we have the on click put this function name here the value of the input will be new message let's add here two beer tracks to break down the lines if we click here it will give us this alert message that's it
if you have any questions do let me know in the comment box below
Comments
Post a Comment