N
Netzwerkidi
Hallo,
ich würde gerne nicht nur den Textknoten selektieren wie im Moment, sondern alles, also Tags und Attribute (LI, Class...) .
Ist nicht ein Unterschied zwischen html() und text()?
Grüße
ich würde gerne nicht nur den Textknoten selektieren wie im Moment, sondern alles, also Tags und Attribute (LI, Class...) .
Ist nicht ein Unterschied zwischen html() und text()?
Grüße
HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns='http://www.w3.org/1999/xhtml'>
<head>
<title>
</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta http-equiv='Content-Language' content='de-DE' />
<meta name='keywords' content='' />
<meta name='description' content='' />
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
</head>
<body>
<ul id="test">
<li class="mcl">-- LI 1 --</li>
<li class="mcl">-- LI 2 --</li>
<li class="mcl">-- LI 3 --</li>
</ul>
<textarea rows="5" cols="30"></textarea>
<script type="text/javascript">
$('#test li').each(function() {
$('body textarea').append($(this).html()+'<br>');
});
</script>
</body>
</html>