How to use an image as an INVISIBLE button in Ionic?

How can one use an image as a button to change the color of a div element in JavaScript?

  • Please suggest the exact code to do so!

  • Answer:

    Wrap image with an "a" tag and use javascipt function on "onclick" event.

Milen Iliev at Quora Visit the source

Was this solution helpful to you?

Other answers

u can just do it bye using div-id:hover <div id="try"> <input type="button" value="button" style=background-color:green;/> </div> in css u can write : #try:hover { background-color-red; } same u can apply for an image too, instead of writing background-color u can give the image source.  in javascript u can use the function "onclick" event .

Priyam Srivastava

HTML<img src="abc.jpg" onclick = "changecolor()" id="image1"></img> <div id="div1"></div>   JavaScript:function changecolor(){ document.getElementById("div1").style.color = "red"; };   jQuery:$('#image1').click(function(){   $('#div1').css('background','red'); //Changes div background to red });

Rohit Falor

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.