Thanks all of you
following code is working for me
<script src="http://ajax.microsoft.com/ajax/jquery/jquery-1.4.2.js" type="text/javascript"></script>
<script type="text/javascript">
jQuery(document).ready(function($) {
if ($('.toplink').length > 0) {
$('.toplink').addClass('adin').attr('data-aid', '114');
}
});
</script>
answered by iamruss
As i am new to stackoverflow, i ask almost same question at Add new class and attributes to div if it exists on the page