-1
I want it to be possible to add and then when update the page it stays saved in my HTML.
.menu {
width: 100%;
height: 70px;
background-color: #56B8BD;
max-height: 70px;
}
.menu ul li {
float: left;
list-style: none;
text-decoration: none;
color: #FFF;
font-size: 18px;
font-weight: bold;
padding-top: 1%;
}
button {
width: 56px;
height: 56px;
border-radius: 56px;
font-size: 18px;
border: none;
float: right;
margin-right: 1%;
margin-top: 0.25%;
}
button:hover {
transform: scale(1.03);
}
<html>
<head>
<script src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
<style type="text/css">
</style>
</head>
<body>
<div class="principal">
<nav class="menu">
<ul>
<li> Barra Menu</li>
</ul>
</nav>
<button onclick="adicionar()">+</button>
</div>
<script>
function adicionar() {
$("body").append("<nav><ul><li> Novo Menu Adicionado</li></ul></nav>");
$("nav").addClass("menu")
}
</script>
</body>
</html>
I don’t know if I understand, but you want this new
div
be added to your HTML file after generated?– João Pedro Schmitz
You need to persist these changes somewhere, whether in database, localStorage, session, memory, disk file, etc, depends on your needs.
– Woss
That would be it but I don’t know how to do it if you can help
– Tecnologic Brasil
How about localstorage? see if it works ai http://kithomepage.com/sos/addeddo.htm
– user60252