<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>title</title>
</head>
<body>
<img class="myPicture" src="" alt="picture">
<img class="myPicture" src="" alt="picture">
<script>
var svgPicture = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><rect x="60" y="10" rx="10" ry="10" width="30" height="30" stroke="black" fill="#f00" stroke-width="5"/></svg>';
document.querySelectorAll(".myPicture")[1].outerHTML = svgPicture;
</script>
</body>
</html>