简体   繁体   中英

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?

这将解决此问题

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

DEMO

Use this:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM