How to replace part of an input value in jQuery?

前端 未结 5 1965
你的背包
你的背包 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:55

    I've just tried this

    $('#title').val($('#title').val().replace("54,",""))
    

    and it worked so i assume that it's the way you call the element "$('input[name=ids]')", why don't you try using an id selector?

    $('#ids')
    

提交回复
热议问题