How does the Win10 system make the Html text box uneditable?

  

Html is familiar to people who are learning web design. They usually come into contact with Html, but Html is so profound, so there is a lot of content that web designers can't understand, so how to make Html text box not editable ? In fact, the method is very simple, we can solve this problem by replacing the attributes and adding code. The following small series introduces you to the Win10 system to make the Html text box uneditable.

Solutions:

In the contents of the text box will only be used to do so and does not allow users to freely modify the presentation is very necessary.

Specific steps:

Method 1: Set the readonly property to true.

Html codes

Method two: disabled property set to true.

Html codes

Tips: difference

readonly disabled and that the latter is provided with a complete ban on the attribute object interaction (expressed as non-rewritable, non Submit, etc.), readonly is committable.

Code word explanation:

1. onfocus Fires when the object gets focus.

2, focus makes the object get the focus.

3, onblur Triggered when the object loses input focus.

4. Blur blurs the contents of the object so that it appears to lose focus.

The above is the solution for the Win10 system that allows you to edit the Html text box. There are three methods. The first and second are replacement attributes, and the third is to add code. I feel that you can choose a method that suits your needs.

Copyright © Windows knowledge All Rights Reserved