Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<html>
<head>
<script src="https://code.jquery.com/jquery-2.2.2.min.js" integrity="sha256-36cp2Co+/62rEAAYHLmRCPIych47CvdM+uTBJwSzWjI=" crossorigin="anonymous"></script>
<script>
$(function(){
$('#add_default').click(function(){
$('#list').append($('<li><a>Default</a></li>'));
});
$('#add_clickable').click(function(){
$('#list').append($('<li><a class="clickme">Clickable</a></li>'));
});
});
</script>
<script>
// @todo change any a.clickme background color to red when clicked
</script>
</head>
<body>
<button id="add_default">Add default</button>
<button id="add_clickable">Add clickable</button>
<ul id="list">
<li><a>Default</a></li>
<li><a class="clickme">Clickable</a></li>
</ul>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment