Получить текст абзаца внутри элемента

Я хочу иметь текстовое значение из <p>внутри элемента <li>.

HTML:

<ul>
  <li onclick="myfunction()">
    <span></span>
    <p>This Text</p>
  </li>
</ul>

JavaScript:

function myfunction() {
  var TextInsideLi = [the result of this has to be the text inside the paragraph"];
}

Как это сделать?

33
задан 24 July 2012 в 15:16
поделиться