Knu
Knu

Reputation: 15136

Attributes added using setAttribute aren't processed by the behavior

For example if I am doing a.setAttribute("begin", b+".focus"); it shows up in the HTML tab of the dev tool but it's completely ignored by the behavior (if I add begin="time1.focus" directly in the html it works just fine).

How do you expose these dynamically-added attributes to the behavior?
Is there another way to add them? (createElement and document.write excluded)

PS: I have already tried using createAttribute + nodeValue + setAttributeNode to no avail.

Upvotes: 2

Views: 252

Answers (1)

Knu
Knu

Reputation: 15136

The secret is the order: you need to set the attributes before adding the behavior's class or using addBehavior.

Upvotes: 1

Related Questions