Jump to content

Guardar dados


Vitor Patrício

Recommended Posts

Jefferson Reis, 

Como posso introduzir esse conceito neste código :

<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" > <head> <meta charset="utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <script type="text/javascript" src="jquery-3.1.1.min.js"></script> <script type="text/javascript"> function AddValue() { var valueToAdd = $( "#Textbox" ).val(); $( "#Listbox" ).append( '<option value="' + valueToAdd + '">' + valueToAdd + '</option>' ); } function RemoveValue() { var valueToRemove = $( "#Textbox" ).val(); $( "#Listbox option[value='" + valueToRemove + "']" ).remove(); } function RemoveSelectedValue() { $( "#Listbox option:selected" ).remove(); } </script> </head> <body> <input id="Textbox" type="text" /> <br /> <input id="Add" type="button" value="Adicionar" onclick="AddValue();" /> <input id="RemoveSelected" type="button" value="Remover" onclick="RemoveSelectedValue();" /> <br /><br /> <select id="Listbox" size="1" style="width: 200px;"> </select> </body> </html>

 

Cumprimentos 

Patrício 

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.