# Interactive Element Example This example demonstrates how to use DOM event handling with Crafter.CppDOM. ## Features - Shows how to create interactive UI elements using C++ - Demonstrates the framework for attaching event listeners - Illustrates the planned callback mechanism for event handling ## Usage The library now provides the foundation for interactive web applications: ```cpp import Crafter.CppDOM; using namespace Crafter::CppDOM; int main(){ // Create UI elements HtmlElement body("body"); body.SetInnerHTML("
Click the button above
"); // Attach event listener HtmlElement button("myButton"); button.AddEventListener("click"); // Future: button.OnClick([]() { // HtmlElement output("output"); // output.SetInnerHTML("Button was clicked!"); // }); return 0; } ``` Note: The full callback mechanism requires additional infrastructure to properly bridge between JavaScript events and C++ callbacks. This implementation provides the framework for future development.