-3

I have a webcam link that I need to place on the page:

    $('#chattools').append('<a href="javascript:void(0)" 
onclick="javascript:webcam(\''+to+'\');">webcam</a>');

them problem is that I want to add this link disabled, that the user cannot click on it. after a condition I want to enable the click using another JS.

it can be done using jquery or js.

I tried to add disabled on href but nothing happens. any ideas how to do this?

RGS
  • 3,760
  • 2
  • 26
  • 54

2 Answers2

1

disabled='disabled' is not working on anchor tags , its supported in old versions only. Please refer below link.

http://techniblogic.com/how-to-disable-anchor-tag-href-links-by-html-css-javascript/#

you can use below syntax

onclick="return false"

krishna
  • 488
  • 2
  • 8
1

use css pointer events property which can be added through jQuery!

Rohit Kishore
  • 520
  • 5
  • 16