# Can alt text be added to images using Javascript?

**URL:** <https://forum.wixstudio.com/t/can-alt-text-be-added-to-images-using-javascript/51770>\
**Category:** Ask the community\
**Tags:** question, code\
**Created:** [August 22, 2023, 9:29pm UTC](https://forum.wixstudio.com/t/can-alt-text-be-added-to-images-using-javascript/51770 "2023-08-22T21:29:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ChrisH](https://avatars.discourse-cdn.com/v4/letter/c/6de8d8/32.png) [@ChrisH](https://forum.wixstudio.com/u/ChrisH)\
**Post date:** [August 22, 2023, 9:29pm UTC](https://forum.wixstudio.com/t/can-alt-text-be-added-to-images-using-javascript/51770/1 "2023-08-22T21:29:07Z")

</div>

I was wondering if it is possible to add Alt Text to my product images using Javascript.

The page is a dynamic item page, I have connected the elements using JS rather than via the dataset in order to speed things up.  
However I’m a bit stuck on how to add the Alt Text using a field from the database within the code.

Is this possible to do at all?

Thanks

---

<div class="post-metadata">

**Author:** ![noahlovell](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/noahlovell/32/118920_2.png) [@noahlovell](https://forum.wixstudio.com/u/noahlovell)\
**Post date:** [August 22, 2023, 10:27pm UTC](https://forum.wixstudio.com/t/can-alt-text-be-added-to-images-using-javascript/51770/2 "2023-08-22T22:27:09Z")

</div>

Yep! If you’ve built it via code, you can set the Alt text using this API - [https://www.wix.com/velo/reference/$w/image/alt](https://www.wix.com/velo/reference/$w/image/alt)

---

<div class="post-metadata">

**Author:** ![ChrisH](https://avatars.discourse-cdn.com/v4/letter/c/6de8d8/32.png) [@ChrisH](https://forum.wixstudio.com/u/ChrisH)\
**Post date:** [August 23, 2023, 8:41pm UTC](https://forum.wixstudio.com/t/can-alt-text-be-added-to-images-using-javascript/51770/3 "2023-08-23T20:41:34Z")

</div>

Thank you, much appreciated
