AmitDiwan has Published 11365 Articles

How to Add CSS Rules to a Stylesheet with JavaScript?

AmitDiwan

AmitDiwan

Updated on 15-Nov-2023 14:10:30

323 Views

The insertRule() helps us add a rule at a defined position in the stylesheet while deleteRule() deletes a specific style on a web page. The following examples illustrate CSS rules that can be added to a stylesheet using JavaScript. Insert a Rule To insert a rule at a defined position, use the ... Read More

How to add a search box inside a responsive navigation menu?

AmitDiwan

AmitDiwan

Updated on 15-Nov-2023 14:05:56

219 Views

To add a search box, use the input type text on a web page. Set the search box inside the navigation menu. Let us first set how to create a responsive navigation menu and place the search box. Set the Navigation Menu and Search box in it To begin with, use the ... Read More

How to add a navigation menu on an image with CSS?

AmitDiwan

AmitDiwan

Updated on 15-Nov-2023 14:01:10

1K+ Views

Adding a navigation menu on a web page is not a difficult task. With that, we can easily add a navigation menu on an image. Let us first set the margin and padding for the HTML document’s body. Set the Style for the Document’s Body The margin and padding are set for ... Read More

How to add a form to a full-width image with CSS?

AmitDiwan

AmitDiwan

Updated on 15-Nov-2023 13:57:37

310 Views

We can easily add a form on a web page. With that, a form can also be added to an image with CSS. In this tutorial, a form will be added to a full-width image with CSS. Let us see how. Set the Styles for the web Page To begin, set the ... Read More

How to add a border to an image with CSS?

AmitDiwan

AmitDiwan

Updated on 15-Nov-2023 13:50:01

678 Views

To add a border to an image, use the border property and set it to the element. This is the shorthand property to set the border style, width, color, etc. The border style can be solid, double, dotted, etc. Add a Border to an Image The following is the code to ... Read More

How elements float in HTML?

AmitDiwan

AmitDiwan

Updated on 15-Nov-2023 13:46:56

299 Views

We can float elements with CSS float property to either the left or right of the containing parent element. Other elements are placed around the floated content. Multiple elements with same value of float property enabled are all placed adjacently. Float Left In this example, the image is placed on the left ... Read More

HTML DOM Input Text object

AmitDiwan

AmitDiwan

Updated on 12-Nov-2023 11:38:59

1K+ Views

The HTML DOM Input Text object is associated with the element with type “text”. We can create and access an input element with type text using the createElement() and getElementById() method respectively.PropertiesFollowing are the properties for the text object −PropertyDescriptionautocompleteTo set or return the autocomplete attribute value of a ... Read More

Unescape HTML entities in JavaScript?

AmitDiwan

AmitDiwan

Updated on 12-Nov-2023 10:48:58

1K+ Views

To unescape HTML entities in JavaScript, use the unescape() function. Let’s say you want to encode special character with the unescape() function − document.write(unescape("Demo%20Text%20")); In this article, we will see two examples − Unescape Entities Decode the Encoded String Unescape Entities Example Lo unescape, we will ... Read More

How can you set the height of an outer div to always be equal to a particular inner div?

AmitDiwan

AmitDiwan

Updated on 10-Nov-2023 03:16:53

1K+ Views

In this article, we will set the left-most inner div to determine the height of the outer div. Consider the following two example − Set the height of an outer div to always be equal to a particular inner div using Flex Set the height of an outer div ... Read More

How to sort an HTML table using JavaScript?

AmitDiwan

AmitDiwan

Updated on 09-Nov-2023 14:46:38

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, ... Read More

Advertisements