我有以下HTML,
"Hi this is vishal"s code <span style='font-family:"arial black"'>vishal</span>". I want to remove " of font-family and want to keep quot; of vishal as it is. I want to change it using jquery.
当我使用mulitple词应用font-family时,radeditor将"
应用于它,我从radeditor中读取该HTML并将其粘贴到我的文本框中。那个时候我想用jQuery改变它。
我怎么能这样做?请帮忙。
答案 0 :(得分:0)
最简单的方法是:
yourText.match(/'font-family(.*)'/)[0].replace(/"/g, '"');
有关replace
功能的更多信息,请参阅本文https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace