vendredi 3 mai 2019

Strikethrough text on checked checkbox [duplicate]

I'm trying to make a div text get a strikethrough on checked checkbox but it doesn't work.

I want to strike over item-title when input type="checkbox" is checked.

This is what i have right now:

input[type=checkbox]:checked+div {
  text-decoration: line-through;
}
<div class="list media-list">
  <ul id="todoList">
    <li class="swipeout"><label class="item-checkbox item-content swipeout-content">
              <input type="checkbox" id="test1" name="checkbox" value="2" />
              <i class="icon icon-checkbox"></i>
              <div class="item-inner">
                <div class="item-title-row">
                  <div class="item-title" for="test1">Test</div>
                  <div class="item-after">2019</div>
                </div>
                <div class="item-subtitle">Test text</div>
                <div class="item-text">By Test</div>
              </div>
            </label>
      <div class="swipeout-actions-right"><a href="#" data-confirm="Are you sure you want to delete this item?" class="swipeout-delete">Delete</a></div>
    </li>
  </ul>
</div>



Aucun commentaire:

Enregistrer un commentaire