We can show html inside html by using using the html entity
‘<‘ as ‘<’ and the ‘>’ as ‘>’
Normally we use like this in html .
<h1> This is H1 tag </h1>But it the result renders html and shows like this
This is h1 tag
So will We will use this To prevent the rendering
<h1> This is H1 tag </h1>
The result
<h1> This is H1 tag </h1>
Now there is a full example which demonstrate this
Copy the code and try by yourself.
<!DOCTYPE html> <html> <head> </head> <body> <h1> This is H1 tag </h1> <h1> This is also H1 tag </h1> </body> </html>
Related Posts
We can add this target=”_blank” in the <a> tag to open link in new tab Example code <!DOCTYPE html> <head> </head> <body> <!– Opens in the same tab –> <a href=”https://en.wikipedia.org/wiki/Main_Page”>Visit Wikipedia (same tab)</a> <br> <!– Opens in a new tab –> <a href=”https://en.wikipedia.org/wiki/Main_Page” target=”_blank”>Visit Wikipedia (new tab)</a> </body> </html> Copy Code
Its essential to change t he button text in some applications . For example Like button. If the current is “Like”, after click on the button it the button text will be “Liked” jquery makes process efficient. <!DOCTYPE html> <html> <head> <script src=”https://code.jquery.com/jquery-3.7.1.min.js”></script> </head> <body> <button class=”like-button”>Like</button> <script> $(document).ready(function(){ $(‘.like-button’).click(function(){ var buttonText = $(this).text(); if […]
Its necessary to prevent text selection when the text is ui feature, to make the webpage more professional. We can prevent the text from selecting by using this in css You cannot select this text You can select this text example code