Chez oim, forum libre

Débattre => Informatique, programmation, geek attitude... => Discussion démarrée par: Songbird le dimanche 17 juillet 2016, 23:39

Titre: Utilisation du DOM - Post it
Posté par: Songbird le dimanche 17 juillet 2016, 23:39
Code
import 'dart:html';
void main() 
{
  var element = querySelector("body");
  var childs = element.children;
  for(var child in childs)
  {
    var attributes_child = child.attributes;
    if(attributes_child['name'] == 'container')
    {
      child.text = "Hi";
      child.style.backgroundColor = "white";
    }
  }
}

HTML:
Code
<!DOCTYPE html>

<html>
  <head>
      <meta charset="utf-8">
      <title>Awesome page</title>
  </head>
  <body>
    <div name="container">
    
    </div>
  </body>
</html>