Created
February 5, 2018 15:06
-
-
Save Kcko/0c6e1fee96482272dd8c09a5bb6c15ca to your computer and use it in GitHub Desktop.
new element jquery
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// <a style="color: red;" onclick="..." href="https://phpfashion.com">blogísek</a> | |
var $el = $('<a>', { | |
href: url, | |
text: title, | |
click: function(e) { | |
alert(this.href); | |
}, | |
css: { | |
color: 'red' | |
} | |
}); | |
// <a href="https://phpfashion.com"><img alt="Logo" src="images/logo.gif"></a> | |
var $el = $('<a>', { | |
href: url, | |
html: $('<img>', { | |
src: 'images/logo.gif', | |
alt: 'Logo' | |
}) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment