Javascript set image src

In javascript elememt.src="image_src"

Check how to

<!DOCTYPE html>
<html>
<head>
   <meta charset="utf-8">
   <title>Javascript set image src</title>
</head>
<body>
   <h1 align="center">Javascript set image src</h1>

   <img src="" id="i" />

<script>
document.getElementById("i").src = 'https://code.hikecdn.com/files/default.jpg';
</script>
</body>
</html>

Related Sourcecode

More Sourcecode

×
Google login
SignUp with Email
X