import Crafter.CppDOM; import std; using namespace Crafter; HtmlElement* body = new HtmlElement("body", R"(

Input GetValue() and SetValue() Example



)"); HtmlElement* button = new HtmlElement("button"); HtmlElement* output = new HtmlElement("valueOutput"); HtmlElement* input = new HtmlElement("input"); int main(){ button->AddClickListener([](Crafter::MouseEvent) { std::string newValue = input->GetValue(); output->SetInnerHTML(newValue); input->SetValue(""); }); }