Print a XML representation of an object

Simple example of printing a XML representation of an object.
<!DOCTYPE html>
<html>
<head>
</head>
<body>

<script>

var person = new Object();
    person.postCode = 03126;
    person.surname = "Kennedy";
    person.age = 12;
    
console.dirxml(person);
    
</script>

</body>
</html>

Responses

0 Replies