dart-lang / html

Dart port of html5lib. For parsing HTML/HTML5 with Dart. Works in the client and on the server.

Home Page:https://pub.dev/packages/html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

document.getElementById incorrect

RedBull996 opened this issue · comments

commented
String htmlStr =
      "<div class='r'><span style = 'margin-left: 20px; font-family: math;color: #949494;'>系统使用</span></div><div class='r_content'><div class='margin-left-10'><span>1. 系统使用的怎么样?</span></div><div class='margin-left-10'><span class='input_content'><input type = 'radio' class='input' id='-531019543-0' name='-531019543' /><label for='-531019543-0'>好</label></span><span class='input_content'><input type = 'radio' class='input' id='-531019543-1' name='-531019543' /><label for='-531019543-1'>不好</label></span><span class='input_content'><input type = 'radio' class='input' id='-531019543-2' name='-531019543' /><label for='-531019543-2'>很不好</label></span></div></div><div class='r_content'><div class='margin-left-10'><span>2. 这里是问题?</span></div><div class='margin-left-10'><span class='input_content'><input type = 'checkbox' class='input' id='425861987-0' name='425861987' /><label for='425861987-0'>设置</label></span><span class='input_content'><input type = 'checkbox' class='input' id='425861987-1' name='425861987' /><label for='425861987-1'>shejie</label></span><span class='input_content'><input type = 'checkbox' class='input' id='425861987-2' name='425861987' /><label for='425861987-2'>shengdao</label></span></div></div><div class='r'><span style = 'margin-left: 20px; font-family: math;color: #949494;'>系统评价</span></div><div class='r_content'><div class='margin-left-10'><span>3. 评价一下下?</span></div><div class='margin-left-10'><textarea class='margin-left-10 mar_top_8' cols='2'  rows='3' id='920053640' name='920053640' style='width: 90%;'></textarea></div></div>";
  late dom.Document document;

  void parseHtml() {
    dom.Document document = htmlparser.parse(htmlStr);
    var el = document.getElementById("-531019543-1");
  }