To highlight use the CSS Text when a Link is clicked

If you click on a link on a website, the link usually directs your browser to another web page. You can set this default behavior, and the links lead to other interesting tasks. For example, you can highlight important Web page text when a user clicks on a link. CSS allows you to define your highlight color


you can Use CSS to Highlight Text When a Link is Clicked
If you click on a link on a website, the link usually directs your browser to another web page. You can set this default behavior, and the links lead to other interesting tasks. For example, you can highlight important Web page text when a user clicks on a link. CSS allows you to define your highlight color, JavaScript, the color on the text.
  • Launch your HTML editor, and open any Web page document.
  • Add this code in the document's "" section:

    This is Heading 1


    This is Heading 2


    Click on " Heading 1
    Click on " Heading 2
    This code creates two headings and two links. The first link calls a JavaScript function called "highlight text." It is the first header passes ID" is "value, "head1", to the function. The second link calls the same function. This link passes the ID of the second Position to the function.
  • Copy the following code and add it to the document's "" section:


    The "highlight" CSS class in the style section of the class sets the background color to yellow. The "highlight text" function, by the left, which was previously described, change the CSS "className" property of the left. To yellow since this className of "highlight" the link the background color changes.
  • Save the HTML document and launch it in your browser. Click on the first link. The JavaScript code is executed and applies the CSS styling highlight on the text of the first heading. Click on the second link. The code underlines that the heading as well.

tips & warnings
  • you don't need to yellow as your highlight color. Change "yellow" to another color name in the document is in the area of "style". You can also lead to highlight the link clicks, other text elements, like spans with text and paragraphs.Create a link and have it to your element ID value to the JavaScript function.








To highlight use the CSS Text when a Link is clicked


If you click on a link on a website, the link usually directs your browser to another web page. You can set this default behavior, and the links lead to other interesting tasks. For example, you can highlight important Web page text when a user clicks on a link. CSS allows you to define your highlight color


you can Use CSS to Highlight Text When a Link is Clicked
If you click on a link on a website, the link usually directs your browser to another web page. You can set this default behavior, and the links lead to other interesting tasks. For example, you can highlight important Web page text when a user clicks on a link. CSS allows you to define your highlight color, JavaScript, the color on the text.
  • Launch your HTML editor, and open any Web page document.
  • Add this code in the document's "" section:

    This is Heading 1


    This is Heading 2


    Click on " Heading 1
    Click on " Heading 2
    This code creates two headings and two links. The first link calls a JavaScript function called "highlight text." It is the first header passes ID" is "value, "head1", to the function. The second link calls the same function. This link passes the ID of the second Position to the function.
  • Copy the following code and add it to the document's "" section:


    The "highlight" CSS class in the style section of the class sets the background color to yellow. The "highlight text" function, by the left, which was previously described, change the CSS "className" property of the left. To yellow since this className of "highlight" the link the background color changes.
  • Save the HTML document and launch it in your browser. Click on the first link. The JavaScript code is executed and applies the CSS styling highlight on the text of the first heading. Click on the second link. The code underlines that the heading as well.

tips & warnings
  • you don't need to yellow as your highlight color. Change "yellow" to another color name in the document is in the area of "style". You can also lead to highlight the link clicks, other text elements, like spans with text and paragraphs.Create a link and have it to your element ID value to the JavaScript function.

To highlight use the CSS Text when a Link is clicked

If you click on a link on a website, the link usually directs your browser to another web page. You can set this default behavior, and the links lead to other interesting tasks. For example, you can highlight important Web page text when a user clicks on a link. CSS allows you to define your highlight color
To highlight use the CSS Text when a Link is clicked
To highlight use the CSS Text when a Link is clicked
Recommend to friends
  • gplus
  • pinterest

Recent posts

Comment

Leave comment

Rating