Skip to content

Instantly share code, notes, and snippets.

View prettydiff's full-sized avatar
💭
Home from military deployment

Austin Cheney prettydiff

💭
Home from military deployment
View GitHub Profile
/*global document*/
//a function to get DOM nodes by nodeType property.
//If you do not supply a value I will give you every DOM node.
//
//example:
// var allComments = document.getNodesByType(8);
// or
// var allComments = document.getNodesByType("COMMENT_NODE");
//
//The accepted string values are the actual node type names, so that the
@patrickfox
patrickfox / Announce.js
Last active February 2, 2024 17:57
Accessibility Tools: Speak text using announce()
/*
$.announce(message, method)
@param(string): message - string of text to be spoken
@param(string): method - polite(default), assertive
Problem:
Using multiple @aria-live throughout your app adds complexity and makes it more difficult to control what is spoken when.
@prettydiff
prettydiff / index.html
Created July 11, 2017 15:50
dom walking versus querySelector - 1 (http://jsbench.github.io/#24d619b25e826b4d2914a138ce9eb274) #jsbench #jsperf
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>dom walking versus querySelector - 1</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>
@prettydiff
prettydiff / index.html
Created July 11, 2017 15:53
dom walking versus querySelector - 2 (http://jsbench.github.io/#ae7713b7b1db5878d60ecd1f827e091d) #jsbench #jsperf
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>dom walking versus querySelector - 2</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>