Adding an information icon to a form element I currently have a number of form elements that I have added an image icon to, which users can click on or hover over for more information... which looks like this:

(The blue image icon is the one users hover over for more information)



When defining the component via render arrays like so:

$component[$this-&gt;componentName] = array(
  '#type' =&gt; 'textfield',
  '#title' =&gt; t('Project Name'),
  '#description' =&gt; t('Enter the name of the project'),
  '#description_display' =&gt; 'before',
  '#required' =&gt; 'True',
);


Is there away to get the image icon to sit along side the element (either the title or the description or the textfield), for example like this:



I am aware that there is the potential to use something like the #attributes tag to add tooltips too (as outlined below), but wondered whether there is scope to add the image icon as I am attempting?

'name' =&gt; array(
  '#title' =&gt; t('Name'),
  '#type' =&gt; 'textfield',
  '#size' =&gt; 30,
  '#maxlength' =&gt; 45,
  '#default_value' =&gt; $item-&gt;Name,
  '#attributes' =&gt; array(
    'title' =&gt; t("Item's name, no longer than 45 characters."),
  )
),
You can use '#prefix' =&gt; 'Some title &lt;img src="/some/image/source"&gt;' instead of '#title' =&gt; t('Name') 

$component[$this-&gt;componentName] =  array(
                  '#prefix' =&gt; t('Some title*') .' &lt;img src="/some/image/source"&gt;',
                  '#type' =&gt; 'textfield',
                  '#size' =&gt; 30,
                  '#maxlength' =&gt; 45,
                  '#default_value' =&gt; $item-&gt;Name,
                  '#attributes' =&gt; array(

                  );


You can add any markup to '#prefix' element of this array.

Or you can add markup even directly to title '#title' =&gt; t('Some title*') .'&lt;img src="/sdfsf"&gt;', but i think there can be some issues with asterisk when a field is required.