During the development process, html components are often not input (read-only), and any component is valid. Next we will provide detailed implementation for you. If you are interested, refer
The Code is as follows:
/**
* Set the page to read-only
*/
Var setReadOnly = function ()
{
Var input = $ ("input ");
Input. each (function (I)
{
$ (This). attr ("onfocus", "this. blur (); return false ;");
$ (This). wrap (function ()
{
Return '';
});
});
Var select = $ ("select ");
Select. each (function (I)
{
$ (This). attr ("onfocus", "this. blur (); return false ;");
$ (This). wrap (function ()
{
Return '';
});
});
Var textarea = $ ("textarea ");
Textarea. each (function (I)
{
$ (This). attr ("onfocus", "this. blur (); return false ;");
$ (This). wrap (function ()
{
Return '';
});
});
Var img = $ ("img ");
Img. each (function (I)
{
$ (This). attr ("onfocus", "this. blur (); return false ;");
$ (This). wrap (function ()
{
Return '';
});
});
}