Home  >  Article  >  Web Front-end  >  How to set non-clickable in jquery

How to set non-clickable in jquery

藏色散人
藏色散人Original
2020-11-23 10:53:262095browse

Jquery method to set non-clickable: first open the corresponding code file; then pass "$("input").attr('readonly', true);$("textarea").attr('readonly ', true);" method can set page elements to be non-clickable.

How to set non-clickable in jquery

Recommended: "jquery video tutorial"

The operating environment of this tutorial: windows7 system, jquery3.2.1 version, This method works for all brands of computers.

jquery sets page elements to be non-clickable, non-editable, and read-only

The code is as follows:

$("input").attr('readonly', true);
$("textarea").attr('readonly', true);
$(':radio').attr('disabled', true);
$(':checkbox').attr('disabled', true);
$(':button').attr('disabled', true);
$('a').removeAttr('onclick');
$('select').attr('disabled', true);

The above is the detailed content of How to set non-clickable in jquery. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:How to download jqueryNext article:How to download jquery