javascript - Add image for readmore drop down -


i want know how add drop down image script.

 <a onclick="showmoreorless(this,'restofarticle');">+sign in </a>  <span id="restofarticle" style="display:none"> </span> 

script

<script>function showmoreorless(thisobj, bonuscontent) { var caption = thisobj.innerhtml; //alert(caption); if (caption == "+sign in") {     document.getelementbyid(bonuscontent).style.display = "inline";     thisobj.innerhtml = "-sign in"; } else {     document.getelementbyid(bonuscontent).style.display = "none";     thisobj.innerhtml = "+sign in"; } } </script> 

i want replace + , - small image icon, how do it?

remove + or - sign. add class anchor , use :before pseudo selector.

html

<a class="icon-left" onclick="showmoreorless(this,'restofarticle');">sign in </a> 

css

.icon-left::before {   content: url('icon image url here'); } 

Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -