jQuery - change value of Div ID [closed] - javascript

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 7 years ago.
Improve this question
I have this:
<div id="something">
content
</div>
And I need change something to somethingnew by using jQuery, so:
<div id="somethingnew">
content
</div>
How can I do it? I've tried function attr, but it doesn't work.
Thanks for advices.

This this:
$("#something").attr("id", "somethingnew");

Try this.
$("#something").attr("id","somethingnew");

$("#something").attr("id", "somethingnew"); should work just fine

Related

On click effect (CSS, HTML, JAVASCRIPT) [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 2 years ago.
Improve this question
I don't know how to get "onclick" effect. I mean how to open new site by click menu. Below i attached example. Please tell what can i do.
https://bslthemes.com/ryan/demo/index-new-no-photo.htm
With addEventListener you have an univerdal method to respond on the click event. Instead of <div> you may use <button> or any other element, that's up to you.
<div id="whatever">Click me</div>
<script>
document.querySelector("#whatever").addEventListener("click", function() {
window.location.replace("https://stackoverflow.com/");
});
</script>

JS issue while Loading Blade View into another using AJAX [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 4 years ago.
Improve this question
I have done with loading a blade view into another using ajax. But, Javascript written in main file is not working for the loaded file. How can I overcome this issue?
bladeView
<span class="selectable " id="" name="">
Rate Here
</span>
JS in bladeMain
$('.selectable').click(function () {
alert('working');
});
Finally found the solution by using following Jquery function
$(document).on('click', '.selectable', function () {
alert('hi');
});

How to make a onclick iframe make a button visible? [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 5 years ago.
Improve this question
I cant figure out how todo this if i can get any help it would mean alot ove been stumped for the last hour looking everywhere for an awnser maybe im searching the wrong this i dont know. please help thanks!
Add this code to your page inside your iframe. The button will be hidden (see inline style css), when you click within the iframe the click event fires on the body element and displays the button. Uses jquery.
<body id="body">
<input id="Btn1" type="button" value="clickMe" style="display:none;">
</body>
$("#body").click(function(){
$("#Btn1").show();
});

Tinymce editor in PHP [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 6 years ago.
Improve this question
I am working in core PHP with the Tinymce editor code.
The Tinymce is working correctly on my localhost. When I upload to a live server it is not working.
The Tinymce editor layout is not displayed on the add new and edit page.
This is my site: http://tinymce.studioscue.in/
Here is the list of jQuery CDN you can add it as follows.
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
Maybe your code missed jQuery file, just try adding this, and try again with your code
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>

Can't use find() after Ajax result [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 8 years ago.
Improve this question
Why I can't used .find() after my ajax insert the HTML?
This is my problem
On line 44 I consoled it, but it returns blank. When I code already the html not the ajax result it's working.
You are looking for the attribute data-id on the p element but it isn't set.
You need to set it...
data-id='+item.id+'
Like you have already done on the buttons
The object will always return blank because you have id'ed the elements correctly
<td><p>'+item.contact_number+'</p></td>
should be
<td><p data-id='+item.id+'>'+item.contact_number+'</p></td>
Updated the fiddle please have a look
http://jsfiddle.net/w2nscncu/4/

Categories

Resources