Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function createBook(comDiv, title, author, isbn) {
- let num = 1
- let div = $(`<div>`)
- div.attr('id', `book${num}`)
- let tit = $(`<p class='title'>${title}</p>`)
- let aut = $(`<p class="author">${author}</p>`)
- let id = $(`<p class="isbn">${isbn}</p>`)
- tit.appendTo(div)
- aut.appendTo(div)
- id.appendTo(div)
- let select = $('<button>')
- .text('Select')
- select.appendTo(div)
- let deselect = $('<button>')
- .text('Deselect')
- deselect.appendTo(div)
- div.appendTo(comDiv);
- select.click(() => {
- div.attr('style', 'border: 2px solid blue')
- })
- deselect.click(() => {
- div.attr('style', 'border: medium none')
- })
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement