var test = $('.text1').val();
var re = /\w+/g
$('.text3').html(test.replace(re, '<i>' + test.match(/\w+/g) + '</i>'));
如果基本值如“链接文本тест”,则返回“<i>Link,text</i> <i>Link,text</i> тест
”。但我需要“<i>Link</i> <i>text</i> текст
”
我该怎么办?
答案 0 :(得分:2)
你不能吗,
body {
font-style: italic; // add italic!important if you need to...
}
你的问题措辞不是很好。
否则如果它必须是jquery或js那么......
$("*").css("font-style", "italic");
那也应该有用。