Question: ```py
if __name__ == "__main__":
  from SettingsHandler import YamlParser
  from UIComponents.IncrementSlider import IncrementSlider
  from UIComponents.ToggleSwitch import ToggleSwitch
  from UI.SettingsPane import SettingsPane
  #from KeyStrokeWrapper import KeyStrokeWrapper
else:
  from Handlers.SettingsHandler import YamlParser
  from Handlers.KeyStrokeWrapper import KeyStrokeWrapper
  from Handlers.UIComponents.IncrementSlider import IncrementSlider
  from Handlers.UIComponents.ToggleSwitch import ToggleSwitch
  from Handlers.UI.SettingsPane import SettingsPane

```

This is starting to get rediculous, how do I import by only file name?

eg: import IncrementSlider rather than from Handlers.UIComponents.IncrementSlider import IncrementSlider

Answer: 
The title is incorrect, as some users pointed out and you should throw some code snippets to showcase what you've been doing and where exactly your problem is.
From the form of the question and details, I would suggest you do some research into the differences between frontend and backend and the solution will be clearer. But regarding your specific issue, assuming you're using Node, probably with Express and some templating engine;

* You'll want to attach a `onClick` listener to your button in your `ejs`/`pug`/`haml` file
* Get the data from your `form` in some way, either by `getElementById` or `FormData`
* Do a `fetch` with `POST` on the endpoint hitting your route -> controller with the data from your form or buttons
* `res.json(...)` or, more likely `res.render(...)` your page with the related data result
Check out Node's [EventEmitter](https://nodejs.dev/learn/the-nodejs-event-emitter). With this class, you can emit events and listen for them. You can also create your own classes which extend `EventEmitter` and make use of its functionality like so:

```
const { EventEmitter } = require('events');

class MyClass extends EventEmitter {
    constructor() {
        super();
    }

    doSomething() {
        this.emit('someEvent');
    }
}

const test = new MyClass();

test.on('someEvent', () => console.log('event was fired'));

test.doSomething();

```