Change only color of * in div using jquery

Marko Vasic

I was wondering is there a way to change only color of * in label? I have something like this:

<label>Name*</label>

and I want to change color of that * to get something like this

<label>Name<color='red'>*</color></label>

Is that possible with jquery? I know there is wrap in jquery, but can I wrap just one character,in this case * ? Thanks in advance for your help.

Anton

Try this

$('label').html($('label').html().replace('*','<span style="color:red">*</span>'));

DEMO

이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.

침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제

에서 수정
0

몇 마디 만하겠습니다

0리뷰
로그인참여 후 검토

관련 기사

분류에서Dev

Using jQuery Switch Case to Change text Color

분류에서Dev

change background color on webpage jQuery

분류에서Dev

How can i change hyperlink color with JQuery?

분류에서Dev

Change Google Map marker color with external jQuery

분류에서Dev

How to change CSS of child element <span> inside parent <div> element Using jQuery onclick event?

분류에서Dev

how to only change content in jquery mobile?

분류에서Dev

script-tutorials.com Colorwheel change color of different div

분류에서Dev

jQuery if statement change div class to another not class

분류에서Dev

Hover text change opacity on div jquery

분류에서Dev

jquery change function hide and show div

분류에서Dev

how to show the div using this in jquery

분류에서Dev

Change background-position horizontal transition for color on scroll jQuery/CSS

분류에서Dev

Jquery Change color by input[type=text] keydown not working

분류에서Dev

jQuery checkbox select all and change background color on select

분류에서Dev

jQuery TimeAgo library to change color of Text if the DateTime is in the Past?

분류에서Dev

Android: change color of disabled text using Theme/Style?

분류에서Dev

Change color of an asp.net button on mouse hover using css

분류에서Dev

Change SVG image color using Css or do it manually in SVG file

분류에서Dev

Using jQuery to change href after .load() call

분류에서Dev

Using jquery slider to change filter blur value

분류에서Dev

Change asp:Label's Text using JQuery

분류에서Dev

jQuery setting input using val() and activating change()

분류에서Dev

Using JQuery to change CSS of element with dynamic class

분류에서Dev

how to change the onclick attribute using jquery

분류에서Dev

Dynamically type a text inside a div using jQuery

분류에서Dev

How to convert a 'div' into a dropdown using CSS/Jquery

분류에서Dev

how to get only 3 lines from div with jquery

분류에서Dev

css or jquery on hover show only the hidden children element of current div

분류에서Dev

jquery change image path on div hover and make its class active?

Related 관련 기사

  1. 1

    Using jQuery Switch Case to Change text Color

  2. 2

    change background color on webpage jQuery

  3. 3

    How can i change hyperlink color with JQuery?

  4. 4

    Change Google Map marker color with external jQuery

  5. 5

    How to change CSS of child element <span> inside parent <div> element Using jQuery onclick event?

  6. 6

    how to only change content in jquery mobile?

  7. 7

    script-tutorials.com Colorwheel change color of different div

  8. 8

    jQuery if statement change div class to another not class

  9. 9

    Hover text change opacity on div jquery

  10. 10

    jquery change function hide and show div

  11. 11

    how to show the div using this in jquery

  12. 12

    Change background-position horizontal transition for color on scroll jQuery/CSS

  13. 13

    Jquery Change color by input[type=text] keydown not working

  14. 14

    jQuery checkbox select all and change background color on select

  15. 15

    jQuery TimeAgo library to change color of Text if the DateTime is in the Past?

  16. 16

    Android: change color of disabled text using Theme/Style?

  17. 17

    Change color of an asp.net button on mouse hover using css

  18. 18

    Change SVG image color using Css or do it manually in SVG file

  19. 19

    Using jQuery to change href after .load() call

  20. 20

    Using jquery slider to change filter blur value

  21. 21

    Change asp:Label's Text using JQuery

  22. 22

    jQuery setting input using val() and activating change()

  23. 23

    Using JQuery to change CSS of element with dynamic class

  24. 24

    how to change the onclick attribute using jquery

  25. 25

    Dynamically type a text inside a div using jQuery

  26. 26

    How to convert a 'div' into a dropdown using CSS/Jquery

  27. 27

    how to get only 3 lines from div with jquery

  28. 28

    css or jquery on hover show only the hidden children element of current div

  29. 29

    jquery change image path on div hover and make its class active?

뜨겁다태그

보관