Javascript Articles - Page 567 of 607

How to integrate Google AdSense into your webpage?

Anjana
Updated on 10-Jan-2020 11:10:20

498 Views

If your website is having a sufficient content and a good number of page views, then start adding some advertisements to earn money. Google AdSense is a free and easy way to earn money by placing ads on your website.Integrating Google AdSense on a website is quite easy. Let’s see the steps:Go to the official website and SIGN IN with the Google Account, which you want to use for AdSense.Setup the account will all the details i.e. website information, content language, etc.Read the Google AdSense Terms and Conditions and follow the Google rules. Also, read the Google Program Policies and do ... Read More

How to call a JavaScript function on a click event?

Saurabh Jaiswal
Updated on 06-Jan-2023 14:26:11

25K+ Views

To call a function on click event in JavaScript, you can use either the addEventListener method or the onclick event attribute. The addEventListener method is a general way to attach an event handler to a DOM element, and it allows you to specify the event and the callback function to be called when the event occurs. The onclick attribute is a specific event attribute that allows you to specify a JavaScript function to be called when the element is clicked. Both methods allow you to specify a function to be called when the element is clicked, but the addEventListener method ... Read More

How to include inline JavaScript inside an HTML page?

Shubham Vora
Updated on 14-Sep-2022 13:45:03

9K+ Views

In this tutorial, we will learn how to include inline JavaScript inside an HTML page. Include inline JavaScript using onclick Event Just like an alert message showing up from the inline JavaScript inside an HTML page, we can also declare a function and call it. This method enabled us to write multiline code inside of a JavaScript function to do more tasks than just an alert message showing. In this example, we will change an element's text and background color by invoking a function from inline JavaScript code. Users can follow the syntax below to include inline JavaScript inside an ... Read More

How to include an external JavaScript inside an HTML page?

Rahul Sharma
Updated on 15-Jun-2020 11:48:03

3K+ Views

The HTML tag is used for declaring a script within your HTML document. Through this, you can define client-side JavaScript. But, what if you want to add external JavaScript inside an HTML Page? Well, you can easily do that too using the src attribute of the tag.The following are the attributes of the tag −AttributeValueDescriptionasyncasyncSpecifies that the script is executed asynchronously.charsetcharsetDefines the character encoding that the script uses.deferdeferDeclares that the script will not generate any content. Therefore, the browser/user agent can continue parsing and rendering the rest of the page.srcURLSpecifies a URI/URL of an external script.typetext/JavaScript application/ecmascript ... Read More

How to use the tag to define a relationship to an external resource?

Johar Ali
Updated on 04-Oct-2019 11:59:36

284 Views

The tag is used in HTML to define a relationship to an external resource. It is used to link external style sheets. It gets added inside the … tag, but does not have a closing tag. Define your external CSS file in it.The CSS file created separately will have all the CSS code inside it. The href attribute adds the css file link.You can try to run the following code to include external CSS in HTML. The HTML file is here, with a link to CSS file style.cssExampleLive Demo                 ... Read More

How to create a valid HTML document with no element?

Amit Sharma
Updated on 04-Oct-2019 11:58:09

524 Views

With HTML, the essentials are doctype declaration, and . But, you will be amazed to know that a valid HTML document can work without the element. The doctype declaration will come always since it tells and instructs the browser about what the page is about.Let’s see an example; here we won’t use the tag. Still, the HTML Document is valid and will work correctly like any other valid HTML DocumentExampleLive Demo    Title of the document           This is heading 1       This is demo text.    

What are the essential tags for an HTML Document?

Shakira Thasleem
Updated on 17-Aug-2022 13:32:40

2K+ Views

Hyper Text Markup Language which is also known as HTML is used to create web pages and web applications. This application made using HTML are accessible to anyone on the world wide web (internet). The Hydertext and Markup language together help define a basic blueprint of the website or web applications.An HTML tag is used to indicate the beginning and closing for an HTML element of an HTML document. With help to these HTML tags a browser transforms an HTML document into a website or web application. In general, a tag is structured with three components, Opening Tag - Marks ... Read More

What is the difference between an acronym and abbr tags?

mkotla
Updated on 10-Jan-2020 10:51:46

782 Views

In layman language, an acronym is a word formed by taking letters of each word in a phrase to form an abbreviation. Acronyms are a subset of abbreviations i.e. abbreviation is a shortened form of a word.The tag isn’t supported in HTML5 and is deprecated now. Do not use. To add abbreviation in HTML, use the tag. Both abbreviation and acronym are the shortened versions and are represented as a series of letters. Some of the examples include, "Mr.", "IST", "MRI", “NASA”, “ISRO” etc. ExampleYou can try to run the following code to add abbreviation in HTML.Live Demo ... Read More

How to Validate your Website Code?

Rahul Sharma
Updated on 04-Oct-2019 12:20:03

334 Views

Website development included writing code in HTML, CSS, JavaScript and the platform you’ve chosen. Your website may look correct, responsive and developed with website standards, but it may have some internal issues.Tools are provided by W3C, to validate your website code:Validate HTML5Validator.nu is a validator, which validates HTML5, ARIA, SVG 1.1 and MathML 2.0. It checks the complete document and points out where the markup isn’t following the doctype.W3C Markup ValidatorIt checks the HTML doctype and the markup. This validator is for those who are using HTML4 or XHTML1.x doctype. It also validates HTML5, but Validator.nu is considered far better since ... Read More

How exactly does