Skip to content

Instantly share code, notes, and snippets.

@bkardell
Last active August 29, 2015 14:01
Show Gist options
  • Save bkardell/063651166bd3ba74c8b1 to your computer and use it in GitHub Desktop.
Save bkardell/063651166bd3ba74c8b1 to your computer and use it in GitHub Desktop.

Given markup like:

<audio-synth id="foo" osc1="square" osc2="sine" frequency="320"></audio-synth>

I can grab a reference to this:

var synth = document.getElementById("foo");

Then I expect (tell me if this is correct) that I can reference the values via properties:

   console.log("osc1: %s\nosc2: %s", synth.osc1, synth.osc2);
   // outputs:
   // osc1: square
   // osc2: sine

As well as via:

   console.log("osc1: %s\nosc2: %s", synth.getAttribute("osc1"), synth.getAttribute("osc2"));
   // outputs:
   // osc1: square
   // osc2: sine
  1. I expect that when I change the property the attribute ? Does or doesn't update?
  2. I expect that when I change the attribute, the property ? does or doesn't reflect?
  3. I expect that I can define a custom setter for these properties which ? (affect/don't affect the attr)?
  4. I expect that I can observe changes to ? (the attribute, the property, both)
  5. My observer would ? (be before native behavior, be after native behavior, potentially supplant native behavior)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment