-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
  • 4,062
  • 4
  • 31
  • 67

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
  • 508
  • 2
  • 8
1

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

Rohit Kishore
  • 542
  • 5
  • 17