Hello!

Please tell me how to make a clickable <div> without using <a> .

Those. There will be no link following. It is necessary only in order to get different data when clicking with JS.

 <div> <div id="id1" class="class1">text1</div> <div id="id2" class="class2">text2</div> <div id="id3" class="class3">text3</div> </div> 

For example, when hovering on a block with id1 mouse cursor, as well as when hovering on <a> , should become like when hovering on a link (cursor: pointer).

Thank!

    2 answers 2

     <div> <div id="id1" class="class1" style="cursor: pointer;" onclick="alert('hello')">text1</div> <div id="id2" class="class2">text2</div> <div id="id3" class="class3">text3</div> </div> 

      The answer lay in the question itself.

      It was necessary to add in class:

       .class1 .class2 . class3{ cursor: pointer; } 

      Thanks to all!