A Pen by sdflkjgnsdlfn on CodePen.
Created
January 22, 2023 12:15
-
-
Save phloreenm/4c5b7c453041db52190aad6a64b8ad9a to your computer and use it in GitHub Desktop.
pKZKOr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0-beta/css/materialize.min.css"> | |
<div class="container"> | |
<div id='newContent'></div> | |
<br> | |
<button class="waves-effect waves-light bg-blue btn right" id="addSelect">Add Select</button> | |
</div> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0-beta/js/materialize.min.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function(){ | |
$('select').formSelect(); | |
}); | |
$("#addSelect").click(function(){ | |
$("#addSelect").addClass("disabled"); | |
$("#addSelect").hide(); | |
$("#newContent").append("<div class='row'><div class='input-field col s12'><select> <option value='' disabled selected>Choose your option</option><option value='1'>Option 1</option><option value='2'>Option 2</option><option value='3'>Option 3</option> </select><label>Materialize Select</label><label>Materialize Select</label></div></div><button class='waves-effect waves-light bg-blue btn right' type='button'>Go</button>").find("select").formSelect(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment