I need to make an application in javascript / jquery / html that counts the clicks of the user on the button and when the counter reaches 10 it locks the button and displays an alert, I do not know why it is not displaying. Anyone know?
<head>
<title>Página</title> <!-- Add page title -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script><!--addJqueryCDN--><linkhrefsrc="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" media="screen"></script> <!-- add bootstrap css CDN -->
</head>
<body>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script><!--addBootstrapCDN--><linkhref="design.css" rel="stylesheet" medi="screen"> <!-- Add css in html -->
<div class="container">
<div class="row">
<div class="col-lg-12 tabela">
linha azul
</div>
</div>
</div>
<script type="text/javascript"> // all javascript/jquery code start here
function add_field()
{
var form = document.getElementsByTagName('form')[0],
input = document.createElement('textarea');
input.setAttribute('type', 'textarea');
input.setAttribute('name', 'item');
form.appendChild(input);
};
function contador()
{
var count = 0;
count++;
if(count == 10){
alert("QWERTY");
}
};
</script>
<form name="input" method="get">
<div class="ui-input-text">
<div data-role="navbar">
<button type="button" onclick="add_field(); contador();">ADD</button><br>
</div>
</div>
</form>
</body>