Ajax callback is not invoked I am using Drupal 7, and I used hook_form_alter() to add the following markup. 

  $form['linkb'] = array(
    '#type' =&gt; 'markup',
    '#markup'=&gt;"&lt;a href=''&gt;Click here &lt;/a&gt;",
    '#title' =&gt; t('something'),
    '#name' =&gt; 'linkb',
    '#ajax' =&gt; array(
      'method' =&gt; 'html', // this is important without this if else condition for ajax will not work.
      'effect' =&gt; 'fade',
      'callback' =&gt; 'clicktell_verification',
      'wrapper' =&gt; 'replace_textfield_div',
    ),
  );


I want to run AJAX when I click on Click here, but this is not working. I have also created a callback function, but it doesn't still work.

Why isn't the AJAX callback being called?
#ajax is never used by elements of markup type. You need to use it with one of the following elements:


button
checkbox
checkboxes
image button
password
radio
radios
select
submit
tableselect
textarea
text_format
textfield