I am working on a API, so i got it ruing but would like to apply some style to it.
I am trying to change the style for var title, country, status and summary without success. Could you hint on how to do it? I have tried a few things but none of them are working.
Thank you!
// creating an empty object to hold functionality of our app var app = {}; // create an init method that will hold all the code that must run upon initialization of app app.init = function(){ $('#subject').on('keyup', function(){ var subject = $(this).val().toLowerCase(); //empty before we ask for result that were there so new results will show up $('#showresults').empty(); app.getShow(subject); }); }; // getShow method will make the Ajax request to the API app.getShow = function(query){ $.ajax({ url: 'http://api.tvmaze.com/search/shows?q=:query', method: 'GET', dataType: 'json', data: { ps: 20, q: query, format: 'json' }, success: function(results){ console.log(results); app.displayShow(results); }, error: function(error){ console.log(error); } }); }; // displayShow will inject our art pieces into the DOM app.displayShow = function(ShowArray){ //forEach is the equivalent of for loop in jQuery. it is used to loop over our array of show ShowArray.forEach(function(showObject){ //create a variable that will hold the html and the h that doesn't exist yet. we use artPiece.title because it's the place holder for the object var title = showObject.show.name ; var country = showObject.show.network.country.name var status= showObject.show.status ; var summary = showObject.show.summary ; //Adding all of our elements into this div var showHtml = $('').addClass('series').append(title + '
' + country + '
' + status + summary); $('#showresults').append(showHtml); }); }; $(function(){ // shortform of document.ready, which waits for all of the HTML document to be loaded before ruing JS app.init(); });
article,aside,details,figcaption,figure,footer,header,hgroup,nav,section,summary{display:block;}audio,canvas,video{display:inline-block;}audio:not([controls]){display:none;height:0;}[hidden]{display:none;}html{font-family:sans-serif;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;}a:focus{outline:thin dotted;}a:active,a:hover{outline:0;}h1{font-size:2em;}abbr[title]{border-bottom:1px dotted;}b,strong{font-weight:700;}dfn{font-style:italic;}mark{background:#ff0;color:#000;}code,kbd,pre,samp{font-family:monospace, serif;font-size:1em;}pre{white-space:pre-wrap;word-wrap:break-word;}q{quotes:201C 201D 2018 2019;}small{font-size:80%;}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline;}sup{top:-.5em;}sub{bottom:-.25em;}img{border:0;}svg:not(:root){overflow:hidden;}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em;}button,input,select,textarea{font-family:inherit;font-size:100%;margin:0;}button,input{line-height:normal;}button,html input[type=button],/* 1 */
input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer;}button[disabled],input[disabled]{cursor:default;}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0;}input[type=search]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box;}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none;}textarea{overflow:auto;vertical-align:top;}table{border-collapse:collapse;border-spacing:0;}body,figure{margin:0;}legend,button::-moz-focus-ier,input::-moz-focus-ier{border:0;padding:0;}
.clearfix:after {visibility: hidden; display: block; font-size: 0; content: " "; clear: both; height: 0; }
* { -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; }
body {
font-family: "Roboto", "Arial", sans-serif;
font-size: 20px;
}
main {
background: #0B1C56;
color: #fff;
}
.container {
max-width: 1200px;
margin: 0 auto;
padding: 50px;
overflow: hidden; /*clearfix*/
}
h1 {
margin-top: 0;
}TV SHOW APP 