I'm trying to code a simple form that will get some text and then display in a dialog box when i click on the submit button.
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<title>Página Teste</title>
</head>
<body>
<header>
<div>
<h1>Questão 4</h1>
</div>
</header>
<div>
<label for="texto">Texto: </label>
<textarea name="texto" id="texto" rows="5" cols="10"></textarea>
<button type="submit" id="submit">Enviar</button>
</div>
<script>
var teste = $("texto").val;
$("submit").on("click", function(){
$("teste").dialog("open");
});
</script>
</body>
</html>
When i click on the button nothing happens, and i've tried some ways of doing this script and none seem to work.
#should be....$("#teste").dialog("open");and$("#texto").val()#....$("#submit").on("click", function(){testewhich could act as a dialog. 2).dialog()is a jQuery-UI method and the library is not loaded. 3) Open the console... You certainly have meaningful errors there.