textContent not working with IE7/8

2 posts, 1 answers
  1. Ian
    Ian avatar
    129 posts
    Member since:
    Jun 2009

    Posted 02 Aug 2012 Link to this post

    I've been using the suggested method of testing the textContent property when a tab is selected to identify the new current tab.. It works fine with Chrome, FF, IE9 but the textContent property appears to be undefined with IE7/8. Example code below. is this a bug?:

    <!DOCTYPE html>
        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
      <script type="text/javascript" src="http://cdn.kendostatic.com/2012.2.710/js/kendo.web.min.js"></script>
        <link href="http://cdn.kendostatic.com/2012.2.710/styles/kendo.common.min.css" rel="stylesheet" />
      <link href="http://cdn.kendostatic.com/2012.2.710/styles/kendo.default.min.css" rel="stylesheet" />
      <div id="example" class="k-content">
            <div id="tabStrip">
                    <li class="k-state-active">
                        New York

      <script type="text/javascript">
          $(document).ready(function () {
              var tabstrip = $("#tabStrip").kendoTabStrip({
                  select: onSelect

          function onSelect(e) {

    Regards, Ian
  2. Answer
    Atanas Korchev
    Atanas Korchev avatar
    8462 posts

    Posted 06 Aug 2012 Link to this post

    Hi Ian,

     Indeed textContent is not supported by IE7/8. The latter has a different property called innerText which returns the text contents of a DOM node.
     Here is how to use both:

    var text  = e.item.textContent || e.item.innerText;

    Atanas Korchev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top