layui, checkbok, select, radio, the problem that cannot be rendered is solved

When we copied the code on layui, and referenced layui.css, and layui.all.js. However, the corresponding effect is still not displayed.
Please see if your js code is at the end.
js code is as follows:
        <script>
		 //Demo
		layui.use('form', function(){
		  var form = layui.form;
		  //Copied from the document does not seem to have this sentence
		  form.render();
		  
		  //listen for submission
		  form.on('submit(formDemo)', function(data){
		    layer.msg(JSON.stringify(data.field));
		    return false;
		  });
		});
	</script>

Be sure to put this code at the end to load the desired effect .

Of course, if you want to put js in any position, you can do this (in any case, you just need to execute the above js code at the end)

Choose one of the following two methods, one is native js, the other is jq

	<script>
		//Native js implementation
		window.onload = function(){
		}
		//jq implementation, of course, the premise is that you import the jq file
		$(function(){
				
		});
	</script>



Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325819070&siteId=291194637