Highlight the JavaScript (JS) code by clicking and dragging your mouse over it.
Once the code is selected, click and hold the mouse button to drag the code towards your bookmark bar.
If your bookmark bar is not visible, you can show it by using the keyboard shortcut Ctrl+Shift+B.
Release the mouse button to drop the code onto the bookmark bar.
The bookmarklet box should now appear on your bookmark bar.
To customize the bookmarklet box, right-click on it and select "Edit" or "Properties," depending on your browser.
In the edit or properties window, you can change the name of the bookmarklet box and assign a unique icon to it.
Save your changes, and now you have a customized bookmarklet box on your bookmark bar that can execute the JavaScript code when clicked.