Sunday, 27 August 2023
Payroll Management Synopsis
Monday, 21 August 2023
CaptchaMvc Mvc5 | C# ASP.Net
CaptchaMvc Mvc5 Using C# ASP.Net Visual Studio 2019
CAPTCHA stands for "Completely Automated Public Turing test to tell Computers and Humans Apart". It is a test used to distinguish between humans and computers. CAPTCHAs are often used to prevent automated spam and abuse.
Saturday, 12 August 2023
Raw Material Management Synopsis
Raw Material Management Synopsis
Wednesday, 9 August 2023
Select Child element and add css using Jquery
Jquery has a powerful DOM selection feature. You can select all child elements from a div or any other container and add CSS to those child elements.
Select all images from a div and change CSS using jquery
In the above UI , When a user clicks on an image A border is applied with padding. But when while click on another image border is applied but it needs to clear the previously selected image border. So the code given below help you to achieve this.
Border of all images inside of div id=''imgcon" will be removed by jquery and add a border on the selected image
<div id="imgcon">
<img src="/Upload/notesimg/1014.jpg" id="img1014" onclick="ChangeCSS('img1014')" >
<img src="/Upload/notesimg/1014.jpg" id="img1015" onclick="ChangeCSS('img1015')">
<img src="/Upload/notesimg/1014.jpg" id="img1016" onclick="ChangeCSS('img1016')">
</div>
<script>
function ChangeCSS(id) {
$("#imgcon
img").css("border", "none");
$('#img' + id).css({ "border": "solid 2px red", "padding": "2px" });
}
</script>
<div id="imgcon">
<img src="/Upload/notesimg/1014.jpg" id="img1014" onclick="ChangeCSS('img1014')" >
<img src="/Upload/notesimg/1014.jpg" id="img1015" onclick="ChangeCSS('img1015')">
<img src="/Upload/notesimg/1014.jpg" id="img1016" onclick="ChangeCSS('img1016')">
</div>
<script>
function ChangeCSS(id) {
$("#imgcon
img").css("border", "none");
$('#img' + id).css({ "border": "solid 2px red", "padding": "2px" });
}
</script>