Skip to content

Instantly share code, notes, and snippets.

@peregrinogris
Created March 17, 2016 21:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peregrinogris/57b01df0e9d0ef02c0aa to your computer and use it in GitHub Desktop.
Save peregrinogris/57b01df0e9d0ef02c0aa to your computer and use it in GitHub Desktop.
<html>
<head>
<link rel="stylesheet" href="http://localhost:3000/build.css">
<!-- <script src="https://d2y1h8z11rh263.cloudfront.net/js/zepto.custom.js"></script> -->
</head>
<body>
<select id="timezone" name="timezone" class="select-control"><option value="America/Sao_Paulo">Brasilia</option></select>
<input type=reset>
<script type="text/javascript">
var select = document.createElement('select');
select.className = 'select-control';
var option = document.createElement('option');
option.value = 'sarasa';
option.text = 'SARASA';
select.appendChild(option);
var option = document.createElement('option');
option.value = 'sarasa2';
option.text = 'SARASA2';
select.appendChild(option);
var option = document.createElement('option');
option.value = 'sarasa3';
option.text = 'SARASA3';
select.appendChild(option);
var option = document.createElement('option');
option.value = 'sarasa4';
option.text = 'SARASA4';
select.appendChild(option);
// select.value= '';
document.querySelector('body').appendChild(select);
console.log(select.value);
// var select = $('select');
// select.className = 'select-control';
// var option = $('option');
// option.value = 'sarasa';
// option.text = 'SARASA';
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment