Crafter.CppDOM/examples/HelloElement
2025-11-12 18:48:36 +01:00
..
main.cpp added view 2025-11-10 22:46:05 +01:00
project.json new crafter.build structure 2025-11-09 20:11:22 +01:00
README.md readme change 2025-11-12 18:48:36 +01:00
run.sh new crafter.build structure 2025-11-09 20:11:22 +01:00

HelloElement Example

This sample demonstrates how to use the HtmlElement class in Crafter.CppDOM.

Features

  • Shows how to create and manipulate HTML elements
  • Demonstrates basic DOM manipulation techniques
  • Illustrates element creation and content setting

Usage

import Crafter.CppDOM;
using namespace Crafter::CppDOM;

int main(){
    HtmlElementView body("body");
    body.SetInnerHTML("Hello World!");
}

Building and Running

crafter-build build executable
run.sh

Then navigate to http://localhost:8080/ in your browser.

If caddy is not installed, you can use your favorite static file server instead.