Skip to content

Instantly share code, notes, and snippets.

View mroien's full-sized avatar

Tim Oien mroien

  • Signal Hill, CA
View GitHub Profile
console.log(`Name:`, await (await browser.status()).os.name);
@mroien
mroien / localStorage.js
Created September 2, 2016 03:49
Set all id's from input into local Storage
$('#submit').on('click', function(){
$('input').each(function(){
var id = $(this).attr('id');
var value = $(this).val();
localStorage.setItem(id, value);
});
});
@mroien
mroien / onKeyUp.js
Created September 2, 2016 03:04
Auto change focus after maxlength
var container = document.getElementsByTagName("form")[0];
container.onkeyup = function(e) {
var target = e.srcElement;
var maxLength = parseInt(target.attributes["maxlength"].value, 10);
var myLength = target.value.length;
if (myLength >= maxLength) {
var next = target;
while (next = next.nextElementSibling) {
if (next == null)
break;