function printDiv(divName) {
var printContents = document.getElementById(divName).innerHTML;
var originalContents = document.body.innerHTML;
document.body.innerHTML = printContents;
window.print();
document.body.innerHTML = originalContents;
}
@media print {
.noprint,
.noprint * {
display: none !important;
height: 0;
}
}
/*****
We can also use :
1. [ visibility: hidden; ]
2. Bootstrap 5 class : [ .d-print-none ]
3. If you don't want to use CSS you can use show/hide with JavaScript.
******/
$("body").append(
"<div style='position:absolute;width:100%;height:100%;z-index:1000;top:0;left:0;'></div>"
);
/*
Use Case : When we want to disable something at the time of AJAX Call.
*/
document.getElementById("iFrameID").contentDocument.location.reload(true);
/* In place of [ iFrameID ] you need to pass your own iframe id */
$("iFrameID").contents().find("body").html("");
/* In place of [ iFrameID ] you need to pass your own iframe id */
git config --system core.longpaths true
git stash save --keep-index --include-untracked
<div style="margin: 50px" class="container">
<h2 type="button"
id="updateimg"
style="
outline: none;
border: none;
background: transparent;
display: flex;
justify-content: center;
align-items: center;
font-size: 16px;
"
>
Click me
<img id="update" height="300" width="auto" src="./assets/jpg/img1.jpg" style=" padding-left: 50px;"/>
</button>
</div>
var plus = "/assets/jpg/img1.jpg";
var minus = "/assets/jpg/img2.jpg";
$("#updateimg").click(function () {
var test = $(this).parent(".container").find("#update");
if (test.attr("src") === plus) {
test.attr("src", minus);
} else {
test.attr("src", plus);
}
});
ng new yourAppName --directory ./
Resourse :
How to create carousel in angular?
Previously
Common Questions in Angular
Coming up next