- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 2416 Articles for HTML
445 Views
Content Spoofing is the term used to define the type of attack by malicious programmers in which they present a fake website as a legitimate one to the user by text injection or html injection. When a web application does not properly handle the data supplied by the user using search etc. then the attacker can take advantage of such a situation and inject additional parameters that go unnoticed by the user. This leads to landing on another web page that looks the same as the original webpage. That page can ask the user to input information which is confidential ... Read More
415 Views
Following is the code to embed JavaScript in html file −Example Live Demo Document body { font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; } .result { font-size: 18px; font-weight: 500; color: rebeccapurple; } Embed javascript in html file let resEle = document.querySelector(".result"); resEle.innerHTML += "Inline javaScript loaded" + ""; script.jsresEle.innerHTML += 'External JavaScript loaded ';OutputThe above code will produce the following output −
418 Views
You can use the concept of placeholder. Following is the JavaScript code −Example Live Demo Document var yourText= "John"; var textBoxSearch = document.getElementById("textSearch"); textBoxSearch.value = yourText; textBoxSearch.onfocus = function() { if (this.value == yourText) { this.value = ''; } } To run the above program, save the file name anyName.html(index.html) and right click on the file and select the option open with live server in VS Code editor.OutputWhen you click on the search box, the placeholder value will be visible. The snapshot is as follows −
471 Views
For this, use the concept of document.getElementById() along with addEventListener(). Following is the JavaScript code −Example Live Demo Document Enter the value: document.getElementById('enterValue').addEventListener("input", function () { console.log('you have entered the value'); }); To run the above program, save the file nameanyName.html(index.html) and right click on the file and select the option open with live server in VS code editor.OutputWhen user enters a value −
1K+ Views
Both HTML and ASP are the web development languages and are widely used in developing web server pages and applications.On the basis of nature of both of the languages we can distinguish between HTML and ASP as follows −Sr. No.KeyHTMLASP1DefinitionHTML is a client-side language which mainly use for developing user interface.HTML stands for Hypertext MarkUp Language in which "Hypertext" refers to the hyperLinks that an HTML page may contain and "MarkUp language" refers to the way tags are used to define the page layout and elements within the page.On other hand ASP is a server-side language developed by Microsoft i.e., ... Read More
1K+ Views
To sort an HTML table using JavaScript, the code is as follows − JavaScript function to sort an HTML Table Consider the following sort function using JavaScript, that will be used to sort an HTML table. function sortTable() { var filterTable, rows, sorted, i, x, y, sortFlag; filterTable = document.querySelector(".filterTable"); sorted = true; while (sorted) { sorted = false; rows = filterTable.rows; for (i = 1; i < rows.length - 1; i++) { ... Read More
876 Views
To sort an HTML list using JavaScript, the code is as follows −Example Live Demo Sorting list example Click to sort Giraffe Camel Dog Lion Cheetah Cat document .getElementsByTagName("button")[0] .addEventListener("click", sortList); function sortList() { var list, i, sortFlag, LiEle, sorted; list = document.querySelector(".animalList"); sortFlag = true; while (sortFlag) { sortFlag = false; LiEle = list.getElementsByTagName("LI"); for (i = 0; i < LiEle.length - 1; i++) { ... Read More
114 Views
To turn off spell check for form elements, the code is as follows −Example Live Demo Disabling Spellcheck Example Your Name: About Yourself Type wrong spelling in the above input field to see spellcheck in action OutputThe above code will produce the following output −On typing something in the input fields −