Output of some elements is not working.
When I now start the website, it should get the XML from text area box and only list some elements.
Here is the script:
<script>
$(document).ready(function() {
// Get text from textarea
var myxml = $("#xml").val();
$(myxml).find("resources").each(function() {
var car = $(this).find("car").text();
var car2 = $(this).find("car2").text();
var out = car+"</br>"+car2;
$("#output").append(out);
});
});
</script>
Here is the body:
<p id="output"></p>
<!--textarea with the xml structure-->
<textarea rows="4" cols="50" id="xml">
<resources>
<string name="car">Ford</string>
<string name="car2">Audi</string>
</resources>
</textarea>
I don't know, where the mistake is.