====== html() ====== ''void **html**(string //text//)'' Outputs HTML code in the questionnaire. This means text can be output or images can be embedded. However, it is more sensible to use HTML for designing layouts ([[:en:create:table-layout|Placing Elements Side by Side]]). * //text//\\ The HTML code which shall be displayed. ===== Example ===== **Note:** It is usually better to create a //Text// in the **List of Questions** to store any longer HTML code. This text is than dragged into the questionnaire page like a question ([[:en:create:texts]]). html('

Welcome!

'); html('

Line breaks will be ignored.

');
===== HTML-Code and other elements ===== Other elements -- especially questions and text elements -- also generate HTML code. You can use ''html()'' to add more HTML code before and after these elements. This allows you, for example, to embed a question in another HTML element in order to change the width. The following PHP code displays the question AB01 centered in a block with a maximum width of 600 pixels. html('
'); question('AB01'); html('
');
You can find an application within the instructions for [[:en:create:table-layout]]. ===== Tips ===== **Tip:** It is better to use text elements to integrate text, images and lengthy HTML codes. These are created in **Text Elements and Labels** and dragged into the questionnaire or integrated into a questionnaire page with ''[[:en:create:functions:text|text()]]''. As a result, the questionnaire remains clear, extended functions (e.g. multilingual surveys or placeholders) are available, and you do not have to worry about using quotation marks. **Note:** The PHP functions ''echo'' and ''print()'' are not released for use in the questionnaire because their output would appear above the questionnaire, rather than in it. Use the function ''html()'' instead. **Note:** In order to use quotation marks in text which already function as a delimiter, the quotation marks have to be devaluated with a back slash (''\''). After this, they will not be recognized as a delimiter anymore and displayed properly. html('

This HTML code contains "double quotation marks".

'); html("

and so does "this".

"); html('

This is how it works with single quotation marks

');
html('

Hello world!

'); // single quotation marks html("

Hello world!

"); // double quotation marks html('

Hello "world"

'); // right html("

Hello "world"

"); // even more right html("

Hello "world"

"); // **Wrong**, because the string // is tagged with double quotation marks and // double quotation marks occur within. // Spread the string out onto multiple lines - often sensible // But usually text() is even more sensible html('

Hello world!

How are you, world?

');
**Note:** Some words (e.g. "new") must not appear in PHP code because they hold a particular meaning in PHP. If one of these words appears in your text, and you definitely want to use the command ''html()'' instead of a text element, then compile the text with fragments: // Wrong: cannot be saved for security reasons html('

This is a new car

'); // text() does not recognize this restriction text('cartext'); // And this workaround also works html('

This is a ne'.'w car

');