A quick intro into the wonderful HTMLHelper class in joomla.
https://api.joomla.org/cms-3/classes/Joomla.CMS.HTML.HTMLHelper.html