saurabhlahoti
saurabhlahoti

Reputation: 466

how to change the color of every occurrence of a specific character in a html page ? (eg for '*')

Like for example instead of using font tag and color attribute before every occurrence of '*' in my html page i want to simply use some lines of code to make them red.

<div class="col-md-1" align="right">Area * </div>
       <div class="col-md-4">
          <select class="form-control" id="area" name="area">
               <option>--Select--</option>
          </select>
       </div>
   </div>
    <br>
    <div class="row">
        <div class="col-md-2"><p id="desc_error" class="text-danger"></p></div>
        <label class="col-md-2">Description *</label>
        <div class="col-md-5">
            <textarea id="desc" class="form-control" name="desc" rows="10" cols="10s" style="resize: none"
          data-toggle="popover" data-trigger="focus" data-placement="right" data-content="To get more relevant responses provide additional details like prerequisites, qualification details and all other needs that you want."></textarea>
        </div>
    </div>
    <br>
    <div class="row">
        <div class="col-md-2"><p id="exp_error" class="text-danger"></p> </div>
        <label class="col-md-2">Job Expires in *</label>
    </div>

Upvotes: 2

Views: 286

Answers (1)

Brent
Brent

Reputation: 1926

Doing it with CSS, I would take this approach:

<div><span>Area</span></div>


 div > span:after {
    content: "*";
    color: red;
 }

Upvotes: 1

Related Questions