Checkbox title as link I want to make the checkbox title as link with target _blank but this doesn't seem working.

$form['approve'] = array(
  '#type' =&gt; 'checkbox',
  '#title' =&gt; l(t('Approve conditions'), 'node/10'),
  '#required' =&gt; TRUE,
);




So the approve conditions should be a link
That code doesn't work on Drupal 8 because l() has been removed from Drupal 8. The correct code for Drupal 8 is closer to the following one.

use Drupal\Core\Link;
use Drupal\Core\StringTranslation\TranslatableMarkup;
use Drupal\Core\Url;

$form['approve'] = array(
  '#type' =&gt; 'checkbox',
  '#title' =&gt; Link::fromTextAndUrl(new TranslatableMarkup('Approve conditions'), Url::fromUri('entity:node/10', ['attributes' =&gt; ['target' =&gt; '_blank']]))-&gt;toString(),
  '#required' =&gt; TRUE,
);


Alternatively, you can put the link in the description.

use Drupal\Core\Link;
use Drupal\Core\StringTranslation\TranslatableMarkup;
use Drupal\Core\Url;

$form['approve'] = array(
  '#type' =&gt; 'checkbox',
  '#title' =&gt; new TranslatableMarkup('Approve conditions'),
  '#description' =&gt; new TranslatableMarkup('By clicking this checkbox, you &lt;a href=":conditions"&gt;approve the conditions&lt;/a&gt;', [':conditions' =&gt; Url::fromUri('entity:node/10', ['attributes' =&gt; ['target' =&gt; '_blank']])]),
  '#required' =&gt; TRUE,
);


Keep in mind that, as said in the comments for l() and url() are removed in favor of a routing based URL generation API, if the shown code is used in a class using the StringTranslationTrait trait, instead of the TranslatableMarkup class you use $this-&gt;t().