Found 8894 Articles for Front End Technology

How to set cursor position in content-editable element using JavaScript?

Rushi Javiya
Updated on 22-Feb-2023 15:00:56

9K+ Views

In HTML, content editable div allows users to edit the content of the div element. We need to pass the contenteditable attribute with true Boolean value to the div element to make any div element editable. The content editable div contains the caret cursor by default, and sometimes we may require to set the caret cursor position in the content editable div element to edit the content of the div. However, we can set the caret cursor position anywhere by clicking at a particular place in the content editable div. This tutorial will teach us to use different ... Read More

How to send row data when clicking the button using javascript?

Rushi Javiya
Updated on 22-Feb-2023 14:59:49

8K+ Views

The table contains multiple rows, and every row contains multiple columns. Also, every column contains multiple HTML elements or texts. Here, we will add the submit button on every table row, and based on the button click, we will access the row's data. We will use JavaScript and jQuery to access the row data, and after that, users can send it anywhere, wherever they want, using API, etc. Use JavaScript to access row data In this approach, we will access the first clicked element. We will find its parent element based on the clicked element, giving us a particular ... Read More

How to create regular expression only accept special formula?

Rushi Javiya
Updated on 22-Feb-2023 14:56:47

789 Views

The regular expression is a pattern containing various characters. We can use the regular expression to search whether a string contains a particular pattern. Here, we will learn to create a regular expression to validate the various mathematical formulas. We will use the test() or match() method to check if particular mathematical formula matches with regular expression or not Syntax Users can follow the syntax below to create regular expressions accepting special mathematical formulas. let regex = /^\d+([-+]\d+)*$/g; The above regex accepts only 10 – 13 + 12 + 23, like mathematical formulas. Regular Expression ... Read More

How to create dynamic breadcrumbs using JavaScript?

Rushi Javiya
Updated on 01-Mar-2023 10:51:47

3K+ Views

The breadcrumbs help website users to understand the navigation path, and windows file explorer is the best example that provides the breadcrumbs. When you open a file explorer, you can see the current location in the file explorer at the top bar. Also, if you click on any location, it jumps to that location. There are two main benefits of using dynamic breadcrumbs on the website. The first is that users can know about the navigation path, and another is users can jump on any location directly in the navigation path. Here, we will see different approaches to ... Read More

How to disable browser print options (headers, footers, margins) from the page with CSS?

Dishebh Bhayana
Updated on 22-Feb-2023 11:37:47

3K+ Views

We can control the print preview page’s header, footer, and margin just with the help of CSS, and even achieve the desired layout and orientation of the paged media. We will be using @page directive to achieve our results. While previewing a print page in the browser, we see some extra page information, like page title, page preview date and time, and the page number in the preview, all present in the page’s header and footer. We also see some extra margin applied to the page preview media. Syntax @media print { @page { ... Read More

How to create a printable webpage using CSS media queries?

Dishebh Bhayana
Updated on 22-Feb-2023 11:37:11

452 Views

We can create a printable webpage, and control the styling in the print preview of a page using the CSS media query print property, @media print. @media print is a CSS media query that allows us to add page styling to the print preview page of any webpage. Using this, we can create a printable webpage by specifying the “visibility” of an HTML element to “visible” or “hidden” under the given media query, We can also add any other styling we want to have in the print preview screen to the @media print query. Syntax @media print { ... Read More

How to Create a Pricing Table using HTML and CSS?

Dishebh Bhayana
Updated on 22-Feb-2023 11:36:28

623 Views

We can create a basic pricing table using just HTML and CSS. A pricing table can be a useful feature to implement in different websites where the purchase of commodities is involved, for example, an e-commerce web application, or travel websites. Let’s learn to create a such table with the help of the example below − Example We will first create an HTML layout of the table in the following index.html file, and then add stylings to it. How to Create Pricing Table using HTML and CSS? ... Read More

How to create the previous and next buttons and non-working on the end positions using JavaScript?

Dishebh Bhayana
Updated on 22-Feb-2023 11:35:10

812 Views

We can create previous and next buttons that would be non-working (or disabled) at their end positions by using vanilla javascript. Javascript is a powerful browser-level language with which we can control and manipulate the DOM elements easily. Here, we will create 2 buttons, and change an HTML element’s content depending on which button is clicked. Example 1 In this example, we will create an “increment” and a “decrement” button which, when clicked, will increment and decrement the HTML element’s content value by 1, respectively. We will also disable the buttons when they reach their extreme positions, which will be ... Read More

How to create pagination in Bootstrap 4?

Dishebh Bhayana
Updated on 22-Feb-2023 11:34:27

274 Views

To implement pagination in our web application, we use the different classes provided to us in Bootstrap 4, like “pagination”, “page-item”, “active”, “disabled”, and so on. Pagination means specifying a page number for a particular page in a series of pages. This could apply to a web application that has lots of pages, a book, or any other entity that has a series of data that we only want to display a part of it at a time. Let’s discuss more about these classes and how we can use them to create a paginated layout in the examples below − ... Read More

How to create numbering using counter-increment property in CSS?

Dishebh Bhayana
Updated on 22-Feb-2023 11:33:22

381 Views

The “counter-increment” property given in CSS is used to increase or decrease the counter values that we can display on a webpage using CSS. CSS counters are useful when we want to count the occurrences of an HTML element in a webpage. We will also use the “counter-reset” CSS property here, which helps us to reset or initialize the CSS counter value to a desired number. Syntax counter-increment − css-counter increment-value; Here, the css-counter refers to the counter variable declared in CSS, and the increment-value refers to the value by which you want to increment or ... Read More

Advertisements