Alex Douglas
Alex Douglas

Reputation: 576

How to remove character in html with jQuery

Here is the html:

  <div class="upme-field-value">
    <div class="upme-rememberme">
        <i class="upme-icon-check-empty"></i>Remember me
        <input type="hidden" name="rememberme" id="rememberme-1" value="0">
    </div>
    <input type="submit" name="upme-login" class="upme-button upme-login" value="Log In">  
    <br>
    <a href="javascript:void(0);" id="upme-forgot-pass-1" class="upme-login-forgot-link "    
    title="Forget?">Forget?</a> 
    | <-------- **** I want to remove this character****
    <a href="/register/" class="upme-login-register-link 
    ">Register</a> 
  </div>

Is There is a way to remove this character "|" from the above html with jQuery or CSS?

Upvotes: 0

Views: 3573

Answers (2)

PeterKA
PeterKA

Reputation: 24638

DEMO

Use this:

$('div.upme-field-value').html(function(i, html) {
    return html.replace(/\|/g,'');
});

Upvotes: 0

Mritunjay
Mritunjay

Reputation: 25882

This will work in this problem

$('div.upme-field-value').html($('div.upme-field-value').html().replace('|',''))

Upvotes: 2

Related Questions