<body>
<p>그림<img/>이다.</p>
<hr/>
<button id='b1'>그림변경</button>
<button id='b2'>속성 제거</button>
<p id='aa'></p>
<p>next selector test1</p>
<p>next selector test2</p>
<p>next selector test3</p>
<script>
$('img').attr('src','bus.jpg');
$('#aa').html("<b>원래그림:" + $('img').attr('src') + "</b>");
$('#b1').click(function() {
$('img').css('width','100px');
$('img').attr('src','fruit.jpg');
$('#aa').html($('#aa').html() + "<hr><b>" + $('img').attr('src') + "</b>"); });
$('#b2').click(function() {
$('img').removeAttr('src');
$('#aa').html("REmove attr...."); });
$('p').prevUntil('#aa').css('color','red');
</script>
이 코드에서 prevUntil 선택자 이용시 test3와 id aa가 들어간 태그 외에 모두 color red 속성이 붙는데 그 이유가 궁금합니다.
test3와 aa사이 태그에만 적용되어야하는게 맞지 않은지 궁금합니다.
답변부탁드립니다!!!!!