How to replace part of an input value in jQuery?

前端 未结 5 1958
你的背包
你的背包 2021-02-13 19:10

I\'ve been trying to figure out a way to replace part of a string in an input value, but haven\'t been able to get it working.

The input field looks li

5条回答
  •  悲&欢浪女
    2021-02-13 19:42

    var replit = $('input[name=ids]').val().replace("54,","");
    $('input[name=ids]').val(replit);
    

    hope that helps :)

    EDIT: if you want a working example: http://jsfiddle.net/Damien_at_SF/XQQC2/

    :)

提交回复
热议问题