아래에는 자바 스크립트 코드 조각이 있습니다.자바 스크립트에서 var 수정 문제
var htmlBlurb = '<div> hello <font color=red>world</font>!!!</div>';
$(htmlBlurb).find('font').each(function(e){
$(this).html("Javascript");
});
console.log(htmlBlurb);
내가
<div> hello <font color=red>Javascript</font>!!!</div>
그러나 htmlBlurb
로 htmlBlurb의 출력을 기대하고는 변경되지 않습니다.
누군가 내가 뭘 놓치고 설명 할 수 있습니까?
당신은 따라서 그냥 문자열 –
의, htmlBlurb''에 (htmlBlurb)'$ '의 결과를 저장 결코''요소를 사용하지 마십시오; 그것은 오래 전에 사용되지 않았다. – j08691
하지만 그들은 '