html - Change the style of an input only when it is followed by a span -


this question has answer here:

how can target <input> when there <span> after it?

<fieldset>    <p>normal input</p>    <div>      <input name="">      <span><i class="icon-cart"></i></span>    </div> </fieldset> 

input + span {} work if <span> before <input> in case after <input> - there way target without using javascript or adding classes parent container?

enter image description here

as can see in image below, want change input border-radius merge span icon on other scenarios.

if want add class say, use jquery this:

$('span').prev('input').addclass('test'); 

or add border-radius:

$('span').prev('input').css('border-radius','3px'); 

Comments

Popular posts from this blog

Payment information shows nothing in one page checkout page magento -

tcpdump - How to check if server received packet (acknowledged) -