kasep Posted April 12, 2020 Share Posted April 12, 2020 Hai... iam newbie in jquery sintaks i try to add icon in the textbox on login.. class textbox is below class form-group row my script is var header = '<span class="form-group row"><i class="fa fa-user"></i></span>'; $('[class="input-group-addon"]').prepend(header); but the result is nothing can you help me Thank you Link to comment Share on other sites More sharing options...
Ingolme Posted April 13, 2020 Share Posted April 13, 2020 I don't see any elements in your code with a class "input-group-addon". You need to add that element to your HTML for this code to work. Either that, or use a different class name to select the element. You should use the class selector instead of the attribute selector, otherwise it will only select elements that have exactly that class name and nothing more. The class selector is the same as in CSS: $('.input-group-addon').prepend(header); jQuery is not necessary for this. It can be done with plain Javascript: var header = '<span class="form-group row"><i class="fa fa-user"></i></span>'; var element = document.querySelector(".input-group-addon"); element.innerHTML = header + element.innerHTML; Link to comment Share on other sites More sharing options...
Alexander Yeshua Posted April 16, 2020 Share Posted April 16, 2020 ahhh... just use htm format... <button> part just add <img src="localanything.ico"/> for submit button func and others... Link to comment Share on other sites More sharing options...
Alexander Yeshua Posted April 16, 2020 Share Posted April 16, 2020 (edited) <p><a href="https://www.facebook.com/alexander.absp"><input onclick="reg()" type="button" img src="source.ico" value="click for be dishonest"/></a></p> Edited April 16, 2020 by Alexander Yeshua Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now