Css Disable Input Code Example


Example 1: disable form field with css


<!DOCTYPE html>
<html>
<head>
<title>Title of the document</title>
<style>
input[name=name]
{
pointer-events: none;
}
</style>
</head>
<body>
<input type="text" name="name" value="w3docs">
</body>
</html>

Example 2: css disable input


<input type="text" name="username" value="admin" tabindex="-1" >

<style type="text/css">
input[name=username]
{
pointer-events: none;
}
</style>

Example 3: css disable input


<input type="text" name="username" value="admin" >
<style type="text/css">
input[name=username]
{
disabled: true; /* Does not work */
}
</style>

Example 4: css disable input


<input type="text" name="username" value="admin" >

<style type="text/css">
input[name=username]
{
pointer-events: none;
}
</style>

Comments

Popular posts from this blog

Converting A String To Int In Groovy

"Cannot Create Cache Directory /home//.composer/cache/repo/https---packagist.org/, Or Directory Is Not Writable. Proceeding Without Cache"

Android How Can I Convert A String To A Editable