Answers for "replace svg with another using javascript"

1

replace svg with another using javascript

<a href="#0" class="expand-link">
  <svg class="icon icon-expand" viewBox="0 0 32 32"><use xlink:href="#icon-expand"></use></svg>
  <svg class="icon icon-contract" viewBox="0 0 32 32"><use xlink:href="#icon-contract"></use></svg>
</a>

<style>
.expand-link:hover .icon-expand,
.expand-link:active .icon-expand{
  display: none;
}
.expand-link:hover .icon-contract,
.expand-link:active .icon-contract{
  display: block;
}
</style>
Posted by: Guest on September-01-2021

Code answers related to "replace svg with another using javascript"

Browse Popular Code Answers by Language