Fetch images of rotmg items/pets from their item id
Include this into your script (You would need jQuery)
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js"></script>
<script src="itemapi.js"></script>
Add the data attribute rotmg
and pass the item id. Examples:
<span data-rotmg="23520"></span>
or<i data-rotmg="23520"></i>
- The item id of empty slot is
-1
or if the passed item id doesn't exist, it would be considered -1.