I have two div and it consist of two different class,when the image source is empty it will have default value.But when the image source change i need to change class properties how to achieve this. Below is my code
<div data-role="view" data-title="Add Photo">
<ul data-role="actionsheet" id="ImagePopUp" data-open="onOpen" data-popup='{"direction": "left"}'>
<li class="km-actionsheet-title"></li>
<li><a data-action="ImagefromGallery">From Gallery</a></li>
<li><a data-action="ImagefromCamera">From Camera </a></li>
</ul>
</div>
<a id="OpenView" data-rel="actionsheet" data-role="button" href="#ImagePopUp" style="text-decoration: none;border:none;">
<img src="images/icon-photo.png" class="icon" />
</a>
<div class="divimage">
<image src="" id="userprofile">
</div>
<div class="divtext">
</div>
CSS
.divimage{
top:2em;
height:30px;
width:100%;
height:100%
}
.divtext{
height:30px;
width:100%;
height:100%
margin-left:5px;
margin-top :2px
}
//replace this class with divimage
.onchangeImageSrc{
some value
}
//replace this class with divtext
.divNewtext{
some value
}
img[src=""] { /* some style */ }srcvalue of image