Html tag beginning with question mark?

Viewed 1450

I'm learning google apps script, and in this tutorial, I saw some weird looking syntax: <? /* JS code */ ?> and <?= /* JS code */ ?>

<!DOCTYPE html>
<html>
  <head>
    <base target="_top">
    <title>Message Display Test</title>
    <link rel="stylesheet" href="https://ssl.gstatic.com/docs/script/css/add-ons1.css">
  </head>
  <body style="padding:3em;">
  <h1>Messages</h1>
    <ul>
    <? for(var m=0;m<messages.length;m++){ ?>
    <li><?= messages[m].getSubject() ?></li>
    <p><?= messages[m].getPlainBody() ?></p>
    <? } ?>
    </ul>
  </body>
</html>

I can kind of understand what is going on, but I'm still confused. I've never seen these while learning HTML. How does this compare to script tags?

2 Answers

The question mark is used for PHP and is incorporated into html to work. It is another programming language related to web design. PHP is mainly used to make more advanced form system.

Related