# Help with Javascript/HTML and iframes

**URL:** <https://forums.ankiweb.net/t/help-with-javascript-html-and-iframes/33705>\
**Category:** Card Design\
**Created:** [August 28, 2023, 11:35am UTC](https://forums.ankiweb.net/t/help-with-javascript-html-and-iframes/33705 "2023-08-28T11:35:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![gadgetzombie](https://avatars.discourse-cdn.com/v4/letter/g/90ced4/32.png) [@gadgetzombie](https://forums.ankiweb.net/u/gadgetzombie)\
**Post date:** [August 28, 2023, 11:35am UTC](https://forums.ankiweb.net/t/help-with-javascript-html-and-iframes/33705/1 "2023-08-28T11:35:42Z")

</div>

Hi all,  
I’m trying to make some interactive Anki cards with the help of [this site](https://bobwallis.github.io/MethodTutor/#notation=x38x14x1258x36x14x58x16x78%2C12&stage=8&title=Cambridge%20Surprise%20Major&allowMethodSelection=false) to learn some new bellringing methods.

I’ve managed to embed the site as an iframe:

```
<iframe src="https://bobwallis.github.io/MethodTutor/#notation=x38x14x1258x36x14x58x16x78%2C12&stage=8&title=Cambridge%20Surprise%20Major&allowMethodSelection=false" style="height: 650px; width:100%;" seamless="seamless"></iframe>"

```

What I’m looking to do is to simulate two mouse clicks to setup the page to match the card I’m looking at - the bell number and the single lead buttons on the website.

I’ve worked out what commands I need to run using the Firefox console

```
document.getElementById('practice_chooser_bell').querySelector( 'input#practice_chooser_bell_'+ 3 ).dispatchEvent( new MouseEvent( 'click' ) );
document.getElementById('practice_chooser_leadOrCourse').querySelector( 'input#practice_chooser_leadOrCourse_lead' ).dispatchEvent( new MouseEvent( 'click' ) );

```

What I’m hoping to end up with (for the link above) is a card for 2:8 which I can then have as a field on my note and replace in the command to set the practice\_chooser\_bell.

However I’m not sure how I can then run these commands from inside Anki and/or whether any changes are required to these lines to enable them to run on elements within the iframe.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/1X/8f1279ababc5879d54e4838989f606cfe55af8c7.jpeg) [@system](https://forums.ankiweb.net/u/system)\
**Post date:** [September 27, 2023, 11:36am UTC](https://forums.ankiweb.net/t/help-with-javascript-html-and-iframes/33705/2 "2023-09-27T11:36:12Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
