Are self-closing tags valid in HTML5?

Problem:

You have an HTML page which contains non-void elements (which have contents with end tag). Suppose <div></div>, <p></p>. Now you don’t want to use end tag (</div>) and instead you like to use self-closing tags like this – <div />, <p />.
Is there any validity of this format in HTML5?

Continue reading Are self-closing tags valid in HTML5?

How to detect if JavaScript is disabled?

Problem:

You have a website contains javascript. But the user of your site disables the javascript or the browser doesn’t work javascript properly. In this case, you need to give a warning to the user that “The site isn’t able to work properly without the browser Javascript enabled”. Continue reading How to detect if JavaScript is disabled?

How to Disable/Turn off Browser Autocomplete on Web Form Field/input Field?

Problem:

You create a form for users in your page.  When a user starts to fill the form, by default, browser shows options or some suggestions to fill in the field, based on earlier typed values. You need to disable this. Continue reading How to Disable/Turn off Browser Autocomplete on Web Form Field/input Field?

How to Redirect a Web Page Automatically to Another Web Page in HTML?

Problem:

You have an html page. May be it is old version or corrupted. When users click for the page, you want to send users to another link or page. Suppose a person visits “website.com/page-a” in the browser and the page is redirected to “website.com/page-b” instead. How do you do that? Continue reading How to Redirect a Web Page Automatically to Another Web Page in HTML?

How to Specify Character Encoding in HTML5?

Problem

May be you want to make sure that the text or special characters you use in the HTML document display correctly in the browsers. So, you need to specify the correct character encoding. Continue reading How to Specify Character Encoding in HTML5?