Tag: code

  • JavaScript: convert String to Hex code

    JavaScript: convert String to Hex code

    JavaScript is a powerful programming language that is widely used in web development. One of the common tasks in JavaScript programming is converting a string to a hexadecimal code. This can be done easily using a built-in function in JavaScript called charCodeAt(). In this article, we will discuss how to convert a string to a […]

  • Use Picture tag to create responsive image (html)

    <picture> <!– Default low resolution image –> <source srcset=”small.jpg” type=”image/jpg”> <!– Medium resolution image –> <source srcset=”medium.jpg” media=”(min-width: 768px)”> <!–High resolution Image –> <source srcset=”large.jpg” media=”(min-width: 1200px)”> <!– Fallback image incase the picture element is not supported –> <img src=”small.jpg” alt=”description of image”> </picture>