我有一個 javascript 工作 html 代碼。但我不需要 html,我需要一個 jquery css它們具有相同的功能。我嘗試通過 jquery css 更改 js html 但它不起作用js html$('html, div:contains('+yourstring+')', document.body).each(function(){ console.log(this); $(this).html($(this).html().replace( new RegExp(yourstring, 'gi'), '<span class=someclass>'+yourstring+'</span>' ));});到 css 查詢$('html, div:contains('+yourstring+')', document.body).each(function(){ console.log(this); $(this).html($(this).html().replace( new RegExp(yourstring, 'gi').css('background-color' 'blue') ));});
更改 javascript html,使用 jquery css
慕妹3146593
2021-06-18 18:05:43