16 lines
No EOL
485 B
C++
16 lines
No EOL
485 B
C++
import Crafter.CppDOM;
|
|
import std;
|
|
using namespace Crafter;
|
|
|
|
HtmlElement body("body","<h1>Interactive Element Demo</h1>"
|
|
"<button id='myButton'>Click Me!</button>"
|
|
"<p id='output'>Click the button above</p>");
|
|
HtmlElement* button = new HtmlElement("myButton"); //prevent destruction
|
|
|
|
|
|
int main() {
|
|
button->AddClickListener([](){
|
|
auto output = HtmlElement("output");
|
|
output.SetInnerHTML("Button was clicked!");
|
|
});
|
|
} |