A quick intro into the wonderful HTMLHelper class in joomla.
https://api.joomla.org/cms-3/classes/Joomla.CMS.HTML.HTMLHelper.html
https://www.youtube.com/watch?v=aHY_hsu7iuk