How JustAnswer Works:
  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site. Ask follow up questions if you need to.
  • Go back-and-forth until satisfied
    Rate the answer you receive.
Ask Ameen Khan Your Own Question
Ameen Khan
Ameen Khan,
Category: Programming
Satisfied Customers: 8288
Experience:  Senior IT Support Specialist at Brookfield Asset Management
Type Your Programming Question Here...
Ameen Khan is online now

Im using bootstrap 4 and I have created a dropdown menu with

Customer Question

JA: Hello. How can I help?
Customer: Im using bootstrap 4 and I have created a dropdown menu with a list of directors, i have a JSON file with movies listed so I want to store inside a variable the dropdown choice , then use that variable to compare it with the JSON file and list films linked to that specific director
JA: Is there a specific language you're coding in?
Customer: javascript, html
JA: What's your objective for this JavaScript project?
Customer: To print out a list of movies by director choice from the dropdown menu
JA: Anything else you want the Programmer to know before I connect you?
Customer: nope
Submitted: 3 months ago.
Category: Programming
Expert:  Ameen Khan replied 3 months ago.

Hi! My name is Ameen and I'll be assisting you. Secure Remote Assistance is NOT REQUIRED (But Helpful)

I am sorry you are having this concern, I will do my best to help you today.


To answer your question ->

​Follow the steps from this link below


Let me know if you have any follow up questions. I am here to help you.

Customer: replied 3 months ago.
This doesnt help my problem. I am using Javascript and bootstrap 4
Expert:  Ameen Khan replied 3 months ago.

You want to know how to print out a list? you mean export?

Customer: replied 3 months ago.
No, I have this bootstrap html.. <li class="nav-item dropdown ml-auto">
<a href="#" class="nav-link dropdown-toggle" data-toggle="dropdown" id=" ">Director</a>
<div class="dropdown-menu dropdown-menu-right">

<a href="#" onclick="director()" class="dropdown-item"> John Woo</a>
<a href="#" onclick="director()" class="dropdown-item"> P.J. Hogan </a>
<a href="#" onclick="director()" class="dropdown-item"> Gus Van Sant</a>
<a href="#" onclick="director()" class="dropdown-item"> James L. Brooks </a>

and this method..

function director() {
var moviesObj1;
var xhttp = new XMLHttpRequest();
var results = "";

xhttp.onreadystatechange = function() {

if (this.readyState == 4 && this.status == 200) {
var moviesTxt1 = this.responseText;
moviesObj1 = JSON.parse(moviesTxt1);

for (var i = 0; i < moviesObj1.length; i++) {
if (moviesObj1[i].Director == ) {


results += '<br>' + moviesObj1[i].Year + ': ' + moviesObj1[i].Title;

document.getElementById('demo').innerHTML = results;
};"GET", "movies.json", true) //used generator here

I want to be able to store inside a variable my dropdown option I will select so i can place that inside my method and compare my JSON movies database file against my choice of dropdown and print out movies related to this director