$(document).ready(function(){
$(".btn").click(function(){
var x=$("#srh").val();
var ur="https://en.wikipedia.org/w/api.php?action=query&titles="+x+"&prop=info&format=json";
$.getJSON(ur, function(json) {
$(".test").html(JSON.stringify(json));
});
});
});
I have made a search bar and when I enter a query and press the search button I want to print the json data I get from the Wiki API to my test div.Unfortunately when I press the button nothing happens.Any ideas?