VAKURU Posted July 30, 2019 Share Posted July 30, 2019 (edited) $(function() { $("#demo").keyup(function(){ var len = $("#demo").val(); if(len.length>8){ var el = $("<p></p>").html(""); $("#holder").append(el); //$("p").addClass("alert alert-warning"); var x = $("<span></span>").html(" Too long"); $("p").append(x); $("span").addClass("glyphicon glyphicon-alert"); stop(); } else if(len.length<=8){ $("#holder p").children().remove(); } }); }); Edited July 30, 2019 by VAKURU Missing Naration Link to comment Share on other sites More sharing options...
smus Posted July 30, 2019 Share Posted July 30, 2019 Can you explain what you want? Link to comment Share on other sites More sharing options...
dsonesuk Posted July 30, 2019 Share Posted July 30, 2019 Don't use actual html tags, use tag name only, for a start. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now